#include<bits/stdc++.h>
typedef long double ld;
const ld pi=std::acos(-1),_0=1e-7l;
int n,ans=0,xs=0,ys=0,lp=0,ap=0,ad=0;
struct pos{int x,y;long long d;ld a;}ps[1007];
ld ls[2007],as[2007];
bool operator<(pos a,pos b){
return a.d!=b.d?a.d<b.d:a.a<b.a;
}
ld dis(ld x,ld y){
return std::sqrt(x*x+y*y);
}
int fix(int a,int l,int r){
if(a<l)return a+r-l;
if(a>=r)return a-r+l;
return a;
}
bool feq(ld a,ld b){
return fabs(a-b)<_0;
}
bool chk(ld x){
while(x>pi*2-_0)x-=pi*2;
while(x<_0-pi*2)x+=pi*2;
return std::fabs(x)<_0;
}
int main(){
scanf("%d",&n);
for(int i=0;i<n;i++)scanf("%d%d",&ps[i].x,&ps[i].y);
for(int i=0;i<n;i++){
xs+=ps[i].x;
ys+=ps[i].y;
}
for(int i=0;i<n;i++){
(ps[i].x*=n)-=xs;
(ps[i].y*=n)-=ys;
ps[i].d=1ll*ps[i].x*ps[i].x+1ll*ps[i].y*ps[i].y;
ps[i].a=atan2(ps[i].y,ps[i].x);
}
std::sort(ps,ps+n);
int p0=0,p1;
while(ps[p0].x==0&&ps[p0].y==0)++p0;
for(p1=p0;p0<n;p0=p1){
while(p1<n&&ps[p1].d==ps[p0].d)++p1;
lp=0;
for(int p2=p0;p2<p1;p2++){
bool ab=1;
ld m=ps[p2].a*2;
for(int l=fix(p2-1,p0,p1),r=fix(p2+1,p0,p1);;l=fix(l-1,p0,p1),r=fix(r+1,p0,p1)){
if(!chk(ps[l].a+ps[r].a-m)){
ab=0;
break;
}
if(l==r)break;
}
if(ab==1)ls[lp++]=ps[p2].a;
if(p1-p0&1)continue;
ab=1;
m=(ps[p2].a+ps[fix(p2+1,p0,p1)].a);
for(int l=fix(p2,p0,p1),r=fix(p2+1,p0,p1),t=p1-p0>>1;t;--t,l=fix(l-1,p0,p1),r=fix(r+1,p0,p1)){
if(!chk(ps[l].a+ps[r].a-m)){
ab=0;
break;
}
if(l==r)break;
}
if(ab)ls[lp++]=m/2.;
}
for(int i=0;i<lp;i++){
ld x=ls[i];
while(x<-_0)x+=pi;
while(x>pi-_0)x-=pi;
ls[i]=x;
}
std::sort(ls,ls+lp);
lp=std::unique(ls,ls+lp,feq)-ls;
if(ad){
int lp1=0,ap1=0;
for(int i=0;i<ap;i++){
while(lp1<lp&&ls[lp1]<as[i]-_0)++lp1;
if(lp1==lp)break;
if(feq(as[i],ls[lp1]))as[ap1++]=as[i];
}
ap=ap1;
}else{
ad=1;
for(int i=0;i<lp;i++)as[ap++]=ls[i];
}
}
printf("%d",ap);
return 0;
}