var n,i,sum,a,b,c:longint;
x1,x2,x3,y1,y2,y3:integer;
begin
assign(input,'trioxorz.in'); reset(input);
assign(output,'trioxorz.out'); rewrite(output);
readln(n);
sum:=0;
for i:=1 to n do begin
readln(x1,y1,x2,y2,x3,y3);
a:=x1*y2-y1*x2;
b:=x2*y3-y2*x3;
c:=x1*y3-x3*y1;
if (a<0) and (b<0) and (c>0) then inc(sum)
else if (a>0) and (b>0) and (c<0) then inc(sum);
end;
writeln(sum);
close(input); close(output);
end.