#include <iostream>
#include <math.h>
using namespace std;

const double epsilon = 0.00001;
	
double distanca(int x1, int y1, int x2, int y2){
	return sqrt(pow(x1-x2,2)+pow(y1-y2,2));
}

bool smaller(double a, double b, double c) {
	return	(-epsilon<(a+b-c))&&((a+b-c)<epsilon);
}

double povrsina(int x1, int y1, int x2, int y2, int x3, int y3){
	return abs((double) x1*(y2-y3)-x2*(y1-y3)+x3*(y1-y2))/2.0;
}


int main()
{

	int N;
	cin>>N;
	int x[3], y[3];
	int c=0;
	
	if(N==3){
		for(int i=0; i<3; i++){
			cin>>x[i]>>y[i];
			if(x[i]==0&&y[i]==0)
				c++;
		}
		
		double k=(y[2]-y[1])/(x[2]-x[1]);
		double z = -k*x[1]+y[1];
		if(smaller(abs(z),0,0) && smaller(distanca(x[1],y[1], 0, 0 ),distanca(0,0,x[2],y[2]),distanca(x[1],y[1],x[2],y[2])))
			c++;
			
		k=((double)y[1]-y[0])/(x[1]-x[0]);
		z = -k*x[0]+y[0];
		if(smaller(abs(z),0,0)<epsilon && smaller(distanca(x[0],y[0], 0, 0 ),distanca(0,0,x[1],y[1]),distanca(x[1],y[1],x[0],y[0])))
			c++;
			
		k=((double)y[2]-y[0])/(x[2]-x[0]);
		z = -k*x[0]+y[0];
		if(smaller(abs(z),0,0)<epsilon && smaller(distanca(x[0],y[0], 0, 0 ),distanca(0,0,x[2],y[2]),distanca(x[2],y[2],x[0],y[0])))
			c++;
			
		double a1 = povrsina(0, 0, x[2], y[2], x[1],y[1]);
		double a2 = povrsina(x[1], y[1], 0, 0, x[0],y[0]);
		double a3 = povrsina(x[2], y[2], x[0],y[0], 0, 0);
		double a4 = povrsina(x[2], y[2], x[1],y[1], x[0], y[0]);
		if(smaller(a1,a2+a3,a4))
			c++;
	}
	
	cout<<c;
	
	return 0;
}