#include<stdio.h>
#include<math.h>
float rastojanje(int x[],int y[])
{
	int i,j;
	float d;
	d=sqrt((x[i]-x[i++])*(x[i]-x[i++])+(y[i]-y[i++])*(y[i]-y[i++]));
	return d;
}
main()
{
	int N,i,x[N],y[N],k,j;
	float a1,a2;
	scanf("%d",&N);
	for(i=0;i<N;i++)
	{
		scanf("%d %d\n",&x[i],&y[i]);
	}
	i=0;j=1;
	a1=rastojanje(x[N],y[N]);
	a2=rastojanje(x[N],y[N]);
	while(i<N && j<N)
	{
		if(a1==2*a2 || a2==2*a1 ) 
		k++;
		i++;j++;
	}
	printf("\n%d",k);
}