#include<stdio.h>
int main()
{
int x1,x2,x3,y1,y2,y3,tc,t,count=0;
scanf("%d",&tc);
for (t=0;t<tc;t++)
{
scanf("%d%d%d%d%d%d",&x1,&y1,&x2,&y2,&x3,&y3);
if (x1!=x2&&x2!=x3&&x3!=x1)
{
if (((y1-y2)*(y3-y2))==-((x1-x2)*(x3-x2)))
count++;
else if (((y2-y1)*(y3-y1))==-((x2-x1)*(x3-x1)))
count++;
else if (((y1-y3)*(y2-y3))==-((x1-x3)*(x2-x3)))
count++;
}
if (x1==x2)
{
if (y3==y2||y3==y1)
count++;
}
else if (x3==x2)
{
if (y1==y3||y1==y2)
count++;
}
else if (x1==x3)
{
if (y3==y2||y1==y2)
count++;
}
}
printf("%d\n",count);
return 0;
}
I2luY2x1ZGU8c3RkaW8uaD4KaW50IG1haW4oKQp7CiAgICBpbnQgeDEseDIseDMseTEseTIseTMsdGMsdCxjb3VudD0wOwoJc2NhbmYoIiVkIiwmdGMpOwoJZm9yICh0PTA7dDx0Yzt0KyspCgl7CgkJc2NhbmYoIiVkJWQlZCVkJWQlZCIsJngxLCZ5MSwmeDIsJnkyLCZ4MywmeTMpOwoJCWlmICh4MSE9eDImJngyIT14MyYmeDMhPXgxKQoJCXsKCQkJaWYgKCgoeTEteTIpKih5My15MikpPT0tKCh4MS14MikqKHgzLXgyKSkpCgkJCWNvdW50Kys7CgkJCWVsc2UgaWYgKCgoeTIteTEpKih5My15MSkpPT0tKCh4Mi14MSkqKHgzLXgxKSkpCgkJCWNvdW50Kys7CgkJCWVsc2UgaWYgKCgoeTEteTMpKih5Mi15MykpPT0tKCh4MS14MykqKHgyLXgzKSkpCgkJCWNvdW50Kys7CgkJfQoJCWlmICh4MT09eDIpCgkJewoJCQlpZiAoeTM9PXkyfHx5Mz09eTEpCgkJCWNvdW50Kys7CgkJfQoJCWVsc2UgaWYgKHgzPT14MikKCQl7CgkJCWlmICh5MT09eTN8fHkxPT15MikKCQkJY291bnQrKzsKCQl9CgkJZWxzZSBpZiAoeDE9PXgzKQoJCXsKCQkJaWYgKHkzPT15Mnx8eTE9PXkyKQoJCQljb3VudCsrOwoJCX0KCX0KCXByaW50ZigiJWRcbiIsY291bnQpOwoJcmV0dXJuIDA7Cn0g