#include <bits/stdc++.h>
using namespace std;
const int maxn = 2055;
int sgn(double x) { return (x > 1e-9) - (x < -1e-9); }
struct TPoint {
  double x, y;
  TPoint() {}
  TPoint(double _x, double _y) : x(_x), y(_y) {}
  TPoint rot90() { return TPoint(y, -x); }
};
TPoint operator+(TPoint a, TPoint b) { return TPoint(a.x + b.x, a.y + b.y); }
TPoint operator-(TPoint a, TPoint b) { return TPoint(a.x - b.x, a.y - b.y); }
bool operator==(TPoint a, TPoint b) {
  return !sgn(a.x - b.x) && !sgn(a.y - b.y);
}
double dot(TPoint a, TPoint b) { return a.x * b.x + a.y * b.y; }
double dot(TPoint a, TPoint b, TPoint c) {
  return dot(TPoint(a - b), TPoint(a - c));
}
double cross(TPoint a, TPoint b) { return a.x * b.y - a.y * b.x; }
double cross(TPoint a, TPoint b, TPoint c) {
  return cross(TPoint(a - c), TPoint(a - b));
}
TPoint pt[maxn], G;
int n, vis[maxn];
vector<int> qc;
int check(int x, int y) {
  TPoint mid = pt[qc[x]] + pt[qc[y]];
  mid.x /= 2, mid.y /= 2;
  TPoint vec = G - mid;
  vec = vec.rot90();
  vector<pair<double, int> > res;
  for (int i = 0; i < (int)qc.size(); ++i) {
    res.push_back(make_pair(dot(vec, (pt[qc[i]] - G)), i));
  }
  sort(res.begin(), res.end());
  int id1 = -1, id2 = -1;
  for (int i = 0; i < ((int)res.size()); ++i) {
    if (res[i].second == x) id1 = i;
    if (res[i].second == y) id2 = i;
  }
  if (id1 + id2 != (int)res.size() - 1) return 0;
  for (int i = 0; i < ((int)res.size()); ++i)
    if (sgn(res[i].first + res[(int)res.size() - i - 1].first)) return 0;
  return 1;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < (n); ++i) {
    scanf("%lf %lf", &pt[i].x, &pt[i].y);
    G = G + pt[i];
  }
  G.y /= n, G.x /= n;
  for (int i = 0; i < n; ++i) {
    if (vis[i]) continue;
    for (int j = 0; j < n; ++j) {
      if (vis[j]) continue;
      if (pt[i] + pt[j] == G + G) {
        vis[i] = vis[j] = 1;
        break;
      }
    }
    if (!vis[i]) qc.push_back(i);
  }
  if ((int)qc.size() == 0) {
    cout << -1 << endl;
    return 0;
  }
  int ans = 0;
  for (int i = 0; i < ((int)qc.size()); ++i) {
    ans += check(0, i);
  }
  cout << ans << endl;
}
