#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
bool cmp(pair<long long, long long> a, pair<long long, long long> b) {
  if (a.first != b.first) return a.first < b.first;
  return a.second < b.second;
}
long long x[2000], y[2000], _x[2000], _y[2000], dst[2000];
pair<long long, long long> K[2000];
bool exs[2000];
int KN;
int main() {
  int n, i, j;
  scanf("%d", &n);
  long long cx = 0, cy = 0;
  for (i = 0; i < n; i++) {
    scanf("%lld%lld", x + i, y + i);
    cx += x[i], cy += y[i];
    _x[i] = x[i], _y[i] = y[i];
    x[i] *= n, y[i] *= n;
  }
  for (i = 0; i < n; i++) {
    x[i] -= cx, y[i] -= cy;
    if (x[i] == 0 && y[i] == 0)
      exs[i] = 0;
    else
      exs[i] = 1;
  }
  for (i = 0; i < n; i++) {
    if (!exs[i]) continue;
    for (j = i + 1; j < n; j++) {
      if (!exs[j]) continue;
      if (x[i] == -x[j] && y[i] == -y[j]) {
        exs[i] = exs[j] = 0;
        break;
      }
    }
  }
  for (i = 0, j = 0; i < n; i++) {
    if (exs[i]) {
      x[j] = x[i];
      y[j] = y[i];
      _x[j] = _x[i];
      _y[j] = _y[i];
      j++;
    }
  }
  n = j;
  if (n == 0) {
    printf("-1\n");
    return 0;
  }
  KN = 0;
  for (i = 0; i < n; i++) {
    long long ey = x[0] + x[i];
    long long ex = -y[0] - y[i];
    for (j = 0; j < n; j++) {
      dst[j] = _x[j] * ex + _y[j] * ey;
    }
    sort(dst, dst + n);
    long long d2 = dst[0] + dst[n - 1];
    bool suc = 1;
    for (j = 0; j <= n - 1 - j; j++) {
      if (dst[j] + dst[n - 1 - j] != d2) {
        suc = 0;
        break;
      }
    }
    if (suc) {
      long long d = gcd(ex, ey);
      ex /= d, ey /= d;
      if (ey < 0 || (ey == 0 && ex < 0)) ey = -ey, ex = -ex;
      K[KN] = make_pair(ex, ey);
      KN++;
    }
  }
  sort(K, K + KN, cmp);
  for (j = 0, i = 0; i < KN; i++) {
    if (i == 0 || K[i] != K[i - 1]) j++;
  }
  printf("%d\n", j);
  return 0;
}
