#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
long long x[2005], y[2005], px[2005], py[2005], l[2005], vx[2005], vy[2005];
bool v[2005];
int cmp(const void *x, const void *y) {
  long long dx = *((long long *)(x)), dy = *((long long *)(y));
  return dx < dy ? -1 : 1;
}
int main() {
  std::ios::sync_with_stdio(0), cin.tie(0);
  int n;
  long long sx = 0, sy = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
    sx += x[i], sy += y[i];
  }
  for (int i = 0; i < n; i++) {
    x[i] = x[i] * n - sx;
    y[i] = y[i] * n - sy;
  }
  memset(v, true, sizeof(v));
  for (int i = 0; i < n; i++) {
    if (!v[i]) continue;
    if (x[i] == 0 && y[i] == 0)
      v[i] = false;
    else {
      for (int j = i + 1; j < n; j++) {
        if (x[i] + x[j] == 0 && y[i] + y[j] == 0) {
          v[i] = v[j] = false;
          break;
        }
      }
    }
  }
  int m = 0;
  for (int i = 0; i < n; i++) {
    if (v[i]) {
      px[m] = x[i];
      py[m] = y[i];
      m++;
    }
  }
  if (m == 0) {
    cout << -1 << endl;
    return 0;
  }
  int ans = 0;
  for (int i = 0; i < m; i++) {
    vx[i] = py[i] + py[0], vy[i] = -(px[i] + px[0]);
    bool rpt = false;
    for (int j = 0; j < i; j++) {
      if (vy[i] * vx[j] == vy[j] * vx[i]) rpt = true;
    }
    if (rpt) continue;
    for (int j = 0; j < m; j++) {
      l[j] = vx[i] * px[j] + vy[i] * py[j];
    }
    qsort(l, m, sizeof(long long), cmp);
    bool ok = true;
    for (int j = 0; j < m; j++) {
      if (l[j] + l[m - j - 1] != 0) {
        ok = false;
        break;
      }
    }
    if (ok) ans++;
  }
  cout << ans << endl;
  return 0;
}
