#include <iostream.h>
#include <stdlib.h>


struct point
{
  double x, y;
};


struct line
{
  point p1,p2;
};

point tr[20][3];
point intersection[100];
int intno;

int comb[20];
int max;
double area;
int n;


inline void swap(point p[], int i,int j)
{
    point temp;
    temp=p[i];
    p[i]=p[j];
    p[j]=temp;
}
// Tells if 3rd point if clockwise to the line(-1),
// or anti-clockwise(+1), or if coincides(0).
int ccw(point p0, point p1, point p2)
{
    if(p0.x==p1.x && p0.y==p1.y) return 0;
    double dx1, dx2, dy1, dy2;
    dx1=p1.x - p0.x; dy1=p1.y - p0.y;
    dx2=p2.x - p0.x; dy2=p2.y - p0.y;
    if(dx1*dy2 > dy1*dx2) return +1;
    if(dx1*dy2 < dy1*dx2) return -1;
    if((dx1*dx2 < 0) || (dy1*dy2 < 0)) return -1;
    if((dx1*dx1+dy1*dy1) < (dx2*dx2+dy2+dy2)) return +1;
    return 0;
}


// Line Segment Intersection
// returns 1 if an intersection, 0 if not
inline int intersect(line l1, line l2)
{
    return    ((ccw(l1.p1, l1.p2, l2.p1) * ccw(l1.p1, l1.p2, l2.p2)) <=0)
           && ((ccw(l2.p1, l2.p2, l1.p1) * ccw(l2.p1, l2.p2, l1.p2)) <=0);
}


// returns the (approximate) angle made by the horizontal


// and the line made by the 2 points.
double theta(point p1, point p2)
{
    double dx, dy;
    int ax, ay;
    double t;
    dx = p2.x - p1.x; ax = abs(int(dx));
    dy = p2.y - p1.y; ay = abs(int(dy));
    t = (ax+ay == 0) ? 0 : (double) dy/(ax+ay);
    if(dx < 0) t = 2-t; else if (dy < 0) t = 4+t;
    return t*90.0;
}

// Given N points, it orders them so that they form a polygon
void simplepolygon(point p[], int N)
{
    int i,j;
    point temp;

    for(i=1;i<N-1;i++)
        for(j=i+1;j<N;j++)
            if(theta(p[0],p[i])>theta(p[0],p[j]))
                swap(p,i,j);
}
// tells if 3 points are collinear or not
inline int collinear(point p1, point p2, point p3)
{
    if((p1.x==p2.x && p1.y==p2.y) || (p1.x==p3.x && p1.y==p3.y) || (p2.x==p3.x && p2.y==p3.y)) return 1;
    if((p2.y-p1.y)*(p3.x-p2.x)==(p3.y-p2.y)*(p2.x-p1.x)) return 1;
    return 0;
}



// Line Intersection
// returns 0 if parallel, -1 if line segments form the same line
// returns +1 if a proper intersection, puts intersection point in x,y
int linesect(line l1, line l2, double& x, double& y)
{
    if(collinear(l1.p1,l1.p2,l2.p1) && collinear(l1.p1,l1.p2,l2.p2)
    && collinear(l2.p1,l2.p2,l1.p1) && collinear(l2.p1,l2.p2,l1.p2)) return -1;

    
    double a1,b1,c1,a2,b2,c2,d;

    a1 = l1.p1.y - l1.p2.y;
    b1 = -1 * (l1.p1.x - l1.p2.x);
    c1 = (a1 * l1.p1.x) + (b1 * l1.p1.y);

    a2 = l2.p1.y - l2.p2.y;
    b2 = -1 * (l2.p1.x - l2.p2.x);
    c2 = (a2 * l2.p1.x) + (b2 * l2.p1.y);

    d = (b1 * a2) - (a1 * b2);

    if(d==0) return 0;

    x=((b1 * c2) - (b2 * c1))/double(d);
    y=((a2 * c1) - (a1 * c2))/double(d);

    return 1;
}

// takes a polygon of N points, and test point
// and returns whether it is inside or not
int inside(struct point t, struct point p[], int N)
{
    int i,j,min=0,count=0;
    point temp1,temp2;

    for(i=1;i<N;i++)
        if(p[i].y < p[min].y) min=i;
    for(i=0;i<N;i++)
        if(p[i].y == p[min].y)
            if(p[i].x < p[min].x) min=i;

    if(min!=0)
    {
        while(min)
        {
            temp1=p[0];
            for(i=0;i<N;i++)
            {
                temp2=p[(i+1)%N];
                p[(i+1)%N]=temp1;
                temp1=temp2;
            }
            min=(min+1)%N;
        }
    }

    j=N-1;
    line lt,lp;
    lt.p1 = t; lt.p2 = t; lt.p2.x = 999999;
    for(i=0;i<N;i++)
    {
        lp.p1=p[i];lp.p2=p[i];
        if(!intersect(lp,lt))
        {
            lp.p2=p[j]; j=i;
            if(intersect(lp,lt)) count++;
        }
    }

    return count & 1;
}


// takes a polygon of N points, and returns its area.
double parea(point polygon[],int N)
{
    int i,j;
    double area = 0;

    for (i=0;i<N;i++)
    {
        j = (i + 1) % N;

        area += polygon[i].x * polygon[j].y;
        area -= polygon[i].y * polygon[j].x;
    }

    area /= 2;
    return(area < 0 ? -area : area);
}

// gives the intersection
void pintersection(point p1[],int np1,point p2[],int np2,point* result,int& intno)
{

  //cout << "\nentering polyi..." << flush;
  
  int i,j;
  
  intno=0;
  if(np1<=0 || np2<=0)
    {
      return;
    }
  
  for(i=0;i<np1;i++)
    {
      if(inside(p1[i],p2,np2))
	{
	result[intno++]=p1[i];
	
	}
      
    }
  if(intno==np1)
    return;
 
  int c=0;
  
  for(i=0;i<np2;i++)
      {
      if(inside(p2[i],p1,np1))
	{result[intno++]=p2[i];c++;}
    }

  
  if(c==np2)
    return;
  
  
  
  if(intno==0)
    return;
  


  //cout << "\ngot : " << intno << " points till now..." << flush;
  // now the line intersections

  line* l1=new line[np1];
  line* l2=new line[np2];
  for(i=0;i<np1;i++)
    {

      l1[i].p1=p1[i];
      l1[i].p2=p1[(i+1)%np1];

    }
  
 for(i=0;i<np2;i++)
   {
     
     l2[i].p1=p2[i];
     l2[i].p2=p2[(i+1)%np2];

     
   }

 //cout << "\n got no of lines as : " << np1 << "," << np2 << flush;
 // got the lines

 double x,y;
 for(i=0;i<np1;i++)
   for(j=0;j<np2;j++)
     {
       
       if(linesect(l1[i],l2[j],x,y)==1 && intersect(l1[i],l2[j]))
	 
	 {
	   result[intno].x=x;
	   result[intno++].y=y;
	   
	 }
       
       
       
     }

 //cout << "\nat the end got :: " << intno << " points";
 
 
 


 simplepolygon(result,intno);

 
 // got the intersection

 //cout << "\nleaving polyi..." << flush;
 
 
 
}


		   
void permute(int p)
{
  int i,j;
  
  if(p>max)
    {
      // have got a combination now in comb

      
      //cout << "\ngot a combo..." << flush;
      for(i=1;i<=max;i++)
	{
	  //cout << comb[i] << "  " ;
	}
      //cout << endl;
      cout << flush;

      
      //compute their area
      int polyno=0;

      point poly[100];
      point result[100];

      int intno;


      // initial values
      
      for(i=0;i<3;i++)
	result[i]=tr[comb[1]-1][i];

      intno=3;
      
      
      
      // get the intersection area
      for(i=1;i<max;i++)
	{
	  
	  for(j=0;j<intno;j++)
	    {
	      poly[j]=result[j];
	    }
	  
	  polyno=intno;
	  
	  //cout << "\ncalling pintersect.." << flush;
	  pintersection(poly,polyno,tr[comb[i+1]-1],3,result,intno);


	  
	}


      //cout << "\nintersection poly has : " << intno << " points" << flush;

      double temp=parea(result,intno);
      //cout << "\narea : " << temp;
      // got the intersection
      area+=temp;
      
    }
  else
    {
      for(int i=comb[p-1]+1;i<=n;i++)
	{
	  //cout << "\nperm : " << i;
	  comb[p]=i;
	  permute(p+1);
	}

    }

  
}


void main()
{

  int i,j;
  

  cin >> n;
  for(i=0;i<n;i++)
    {
      cin >> tr[i][0].x >> tr[i][0].y;
        cin >> tr[i][1].x >> tr[i][1].y;
	  cin >> tr[i][2].x >> tr[i][2].y;
    }

  //cout << "\nhere" << flush;
  // got the triangles

  int mult=1;

  double totalarea=0;
  
  for(i=0;i<n;i++)
    {

      // cout << "\ncalc area for group of : " << i << flush;
      
      area=0;
      comb[0]=0;
      max=i+1;

      //cout << "\ncalling permute...with << " << max << flush;;
      

      permute(1);

      //cout << "\npermuted..." << flush;
      totalarea+=area*mult;
      mult*=-1;

      //cout << "\ntotalrea till now : " << totalarea;
    }


  cout << totalarea << flush;
  
}
















