#include <bits/stdc++.h>
using namespace std;
int read() {
  int s = 0, t = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') t = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') s = s * 10 + ch - '0', ch = getchar();
  return s * t;
}
struct poi {
  long long x, y;
} p[2100];
int n;
bool operator<(poi a, poi b) { return a.x == b.x ? a.y < b.y : a.x < b.x; }
bool operator==(poi a, poi b) { return a.x == b.x && a.y == b.y; }
long long dis(poi a, poi b) {
  return (a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y);
}
long long cross(poi a, poi b) { return a.x * b.y - a.y * b.x; }
poi operator-(poi a, poi b) { return (poi){a.x - b.x, a.y - b.y}; }
bool del[2100];
long long w[2100];
map<pair<long long, long long>, bool> qwq;
long long gcd(long long x, long long y) { return x ? gcd(y % x, x) : y; }
int main() {
  n = read();
  for (int i = 1; i <= n; i++) p[i].x = read(), p[i].y = read();
  if (n <= 2)
    puts("-1");
  else {
    sort(p + 1, p + n + 1);
    long long nx = 0, ny = 0;
    int nn = 0;
    for (int i = 1; i <= n; i++) nx += p[i].x, ny += p[i].y;
    for (int i = 1; i <= n; i++) p[i].x *= n, p[i].y *= n;
    poi o = (poi){nx, ny};
    for (int i = 1; i <= n; i++)
      if (p[i] == o) {
        for (int j = i + 1; j <= n; j++) p[j - 1] = p[j];
        n--;
        i--;
      }
    for (int i = 1; i <= n; i++) p[i] = p[i] - o;
    for (int i = 1; i <= n; i++)
      if (!del[i])
        for (int j = i + 1; j <= n; j++)
          if (!(p[j].y + p[i].y) && !(p[i].x + p[j].x)) {
            del[i] = del[j] = 1;
            break;
          }
    nn = 0;
    for (int i = 1; i <= n; i++)
      if (!del[i]) p[++nn] = p[i];
    n = nn;
    if (!n) return puts("-1"), 0;
    for (int i = 1; i <= n; i++) {
      long long px = (p[1].x + p[i].x), py = (p[1].y + p[i].y);
      if (px && py) {
        long long g = gcd(abs(px), abs(py));
        px /= g, py /= g;
      }
      if (py && !px) py = 1;
      if (!py && px) px = 1;
      if (px < 0) px = -px, py = -py;
      for (int j = 1; j <= n; j++) w[j] = -py * p[j].x + px * p[j].y;
      sort(w + 1, w + n + 1);
      bool azy = 1;
      for (int j = 1; j + j <= n; j++)
        if (w[j] + w[n + 1 - j]) {
          azy = 0;
          break;
        }
      if (azy) qwq[make_pair(px, py)] = 1;
    }
    printf("%d\n", qwq.size());
  }
  return 0;
}
