program Project2; {$APPTYPE CONSOLE} uses SysUtils; var inp,outp: textfile; n,i,j,l,p,a: integer; x,y: array[1..3000]of longint; b: array[1..3000]of boolean; begin assignfile(inp,'Task5.in'); assignfile(outp,'Task5.out'); reset(inp); rewrite(outp); readln(inp,n); for i:=1 to 3*n do begin read(inp,x[i]); readln(inp,y[i]); end; p:=0; a:=0; for i:=1 to 3*n do b[i]:=false; for i:=1 to 3*n do if b[i]=true then continue else for j:=i+1 to 3*n do if b[j]=true then continue else for l:=j+1 to 3*n do if b[l]=true then continue else begin if ((x[i]=x[j])and(y[i]=y[j]))or((x[i]=x[l])and(y[i]=y[j]))or((x[j]=x[l])and(y[j]=y[l]))then continue; {ij,il} if ((x[j]-x[i])*(x[l]-x[i]))+((y[j]-y[i])*(y[l]-y[i]))=0 then begin b[i]:=true; b[j]:=true; b[l]:=true; inc(a); end; {ij,jl} if ((x[j]-x[i])*(x[l]-x[j]))+((y[j]-y[i])*(y[l]-y[j]))=0 then begin b[i]:=true; b[j]:=true; b[l]:=true; inc(a); end; {il,jl} if ((x[l]-x[i])*(x[l]-x[j]))+((y[l]-y[i])*(y[l]-y[j]))=0 then begin b[i]:=true; b[j]:=true; b[l]:=true; inc(a); end; {for p:=1 to 3*n do write(b[p],' '); readln;} end; if a<>n then write(outp,'0') else write(outp,a); closefile(inp); closefile(outp); end. {while p:=0 do begin for i:=1 to 3*n do for i:=2 to 3*n-1 do if (x[i]=x[j])and(y[i]=y[j])then continue else begin end; end;} {if (x[i]*x[j])+(y[i]*y[j])=0 then begin b[i]:=true; b[j]:=true; inc(a); end; if (x[i]*x[l])+(y[i]*y[l])=0 then begin b[i]:=true; b[l]:=true; inc(a); end; if (x[l]*x[j])+(y[l]*y[j])=0 then begin b[l]:=true; b[j]:=true; inc(a); end;}