### 代码

#include
#define maxn 2010
#define mp make_pair
#define eps 1e-9
using namespace std;
int n,id[maxn],x,ans;
struct Node{
double x,y;
Node (double a=0,double b=0){
x=a,y=b;
}
Node operator + (Node a){
return Node(x+a.x,y+a.y);
}
Node operator - (Node a){
return Node(x-a.x,y-a.y);
}
Node operator / (double a){
return Node(x/a,y/a);
}
double operator * (Node a){
return x*a.x+y*a.y;
}
bool operator == (Node a){
return fabs(x-a.x) a[maxn];
bool check(int pos){
mid=(p[x]+p[pos])/2;
vec=root-mid;
vec=Node(vec.y,-vec.x);
for (register int i=1;i<=n;++i)
a[i]=mp(vec*p[i],i);
sort(a+1,a+1+n);
for (register int i=1;i<=n;++i)
id[a[i].second]=i;
if (id[x]+id[pos]!=n+1) return 0;
double cmp=a[1].first+a[n].first;
for (register int i=1;i<=n;++i)
if (fabs(a[i].first+a[n-i+1].first-cmp)>eps) return 0;
return 1;
}
int main(){
scanf("%d",&n);
for (register int i=1,a,b;i<=n;++i)
scanf("%lf%lf",&a,&b),p[i]=Node(a,b),
root=root+p[i];
root=root/n;
for (register int i=1;i<=n;++i){
bool sub=0;
for (register int j=1;j<=n;++j)
if (p[i]+p[j]==root+root) sub=1;
if (!sub) x=i;
}
if (!x) return puts("-1"),0;
for (register int i=1;i<=n;++i)
if (check(i)) ans++;
printf("%d",ans);
}