#include <bits/stdc++.h>   using namespace std;   const int N = 2005;   const long double ep = 1e-10;   struct pnt {     long double x, y;     pnt() { x = y = 0; }     pnt(long double xx, long double yy) { x = xx, y = yy; }     pnt operator+(pnt a) { return pnt(x + a.x, y + a.y); }     void in() {       int xx, yy;       cin >> xx >> yy;       x = xx, y = yy;     }     long double operator^(const pnt &a) const { return x * a.y - y * a.x; }     bool operator<(const pnt &a) const { return x != a.x ? x < a.x : y < a.y; }     bool int_pnt(pnt &a) {       int xx = x + (x > 0 ? 0.5 : -0.5), yy = y + (y > 0 ? 0.5 : -0.5);       if (abs(x - xx) < ep && abs(y - yy) < ep) {         a = pnt(xx, yy);         return 1;       }       return 0;     }   } p[N], M, MM;   vector<pnt> P;   int n;   map<pnt, int> h;   bool opp[N];   int main() {     cin >> n;     for (int i = 1; i <= n; i++) {       p[i].in();       M = M + p[i];       h[p[i]] = i;     }     M.x /= n, M.y /= n;     MM.x = M.x * 2, MM.y = M.y * 2;     for (int i = 1; i <= n; i++)       if (!opp[i]) {         pnt pp = pnt(MM.x - p[i].x, MM.y - p[i].y), qq;         if (pp.int_pnt(qq) && h.count(qq)) {           int t = h[qq];           opp[t] = 1;           opp[i] = 1;         }       }     for (int i = 1; i <= n; i++)       if (!opp[i]) P.push_back(p[i]);     if (P.empty())       puts( -1 );     else {       pnt A = P[0];       int ans = 0;       vector<pnt> D;       for (auto x : P) {         pnt AM = A + x;         AM.x /= 2, AM.y /= 2;         pnt d = pnt(M.x - AM.x, M.y - AM.y);         vector<long double> pos, neg;         for (auto y : P) {           long double l = d ^ pnt(y.x - AM.x, y.y - AM.y);           if (abs(l) < ep) continue;           if (l < 0)             neg.push_back(-l);           else             pos.push_back(l);         }         if (neg.size() != pos.size()) continue;         sort(neg.begin(), neg.end());         sort(pos.begin(), pos.end());         bool flag = 0;         for (int i = 0; i < pos.size(); i++)           if (abs(pos[i] - neg[i]) > ep) flag = 1;         if (!flag) D.push_back(d);       }       for (auto &x : D) {         if (x.y < 0) x.y = -x.y, x.x = -x.x;         if (x.y == 0 && x.x < 0) x.x = -x.x;       }       sort(D.begin(), D.end(),            [](const pnt &x, const pnt &y) { return (x ^ y) > 0; });       int sz = D.size();       for (int i = 0, j; i < sz; i = j) {         for (j = i; j < sz && (D[i] ^ D[j]) == 0; j++)           ;         ans++;       }       printf( %d n , ans);     }     return 0;   }   