#include <bits/stdc++.h>
using namespace std;
bool debug = 0;
int n, m, k;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
string direc = "RDLU";
long long ln, lk, lm;
void etp(bool f = 0) {
  puts(f ? "YES" : "NO");
  exit(0);
}
void addmod(int &x, int y, int mod = 1000000007) {
  assert(y >= 0);
  x += y;
  if (x >= mod) x -= mod;
  assert(x >= 0 && x < mod);
}
void et() {
  puts("-1");
  exit(0);
}
long long fastPow(long long x, long long y, int mod = 1000000007) {
  long long ans = 1;
  while (y > 0) {
    if (y & 1) ans = (x * ans) % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return ans;
}
long long gcd1(long long x, long long y) {
  long long z = y;
  while (x % y != 0) {
    z = x % y;
    x = y;
    y = z;
  }
  return z;
}
struct Point {
  long long x, y;
  Point() {}
  Point(long long x, long long y) : x(x), y(y) {}
  long double abs() const { return hypot(x, y); }
  long double arg() const { return atan2(y, x); }
  Point operator*(double o) const { return Point(x * o, y * o); }
  Point operator+(const Point &o) const { return Point(x + o.x, y + o.y); }
  Point operator-(const Point &o) const { return Point(x - o.x, y - o.y); }
  bool operator<(const Point &o) const {
    return x < o.x - 1e-9 || (x < o.x + 1e-9 && y < o.y - 1e-9);
  }
  friend bool operator==(const Point &r1, const Point &r2) {
    return r1.x == r2.x && r1.y == r2.y;
  }
  Point scale(double o) const { return *this * (o / abs()); }
  Point rotY() const { return Point(-y, x); }
  Point rotX() const { return Point(y, -x); }
  Point div(long long z) const { return Point(x / z, y / z); }
  long long cross(Point b) const { return x * b.y - b.x * y; }
  long long dot(Point b) const { return x * b.x + y * b.y; }
  long double disToSeg(Point &a, Point &b) {
    return fabs(((*this) - a).cross(b - a) / (b - a).abs());
  }
  pair<long long, long long> getVec() {
    if (x == 0) return {0, 1};
    if (y == 0) return {1, 0};
    long long gg = gcd1(::abs(x), ::abs(y));
    long long px = x / gg, py = y / gg;
    if (px < 0) {
      px *= -1;
      py *= -1;
    }
    return {px, py};
  }
  void readin() { scanf("%lld%lld", &x, &y); }
};
Point p[2105], C, rp[2105];
int cnt, ans;
long long ttPs;
unordered_map<long long, int> mp;
bool vis[2105];
int M = 2e9;
long long gk(pair<long long, long long> pr) {
  if (pr.second < 0) return -pr.first * M + pr.second;
  return pr.first * M + pr.second;
}
pair<long long, long long> rpg(long long val) {
  int ok = 1;
  if (val < 0) {
    val *= -1;
    ok = -1;
  }
  long long y = val % M;
  return {(val - y) / M, y * ok};
}
void fmain(int ID) {
  scanf("%d", &n);
  if (n <= 2) et();
  C = Point(0, 0);
  debug = 0;
  for (int(i) = 1; (i) <= (int)(n); (i)++) {
    p[i].readin();
    if (n == 2000 && i == 1 && p[i].x == -3933) debug = 1;
    p[i] = p[i] * 2 * n;
    C = C + p[i];
  }
  C.x /= n;
  C.y /= n;
  ttPs = n / 2;
  for (int(i) = 1; (i) <= (int)(n); (i)++)
    if (!vis[i])
      for (int j = i + 1; j <= n; j++) {
        Point sc = (p[i] + p[j]).div(2);
        if (sc == C) {
          ttPs--;
          vis[i] = 1;
          vis[j] = 1;
          break;
        }
        Point pp = sc - C;
        mp[gk(pp.getVec())]++;
      }
  if (ttPs == 0) et();
  for (int(i) = 1; (i) <= (int)(n); (i)++)
    if (!vis[i]) rp[++cnt] = p[i];
  for (auto &ppt : mp)
    if (ppt.second >= ttPs) {
      vector<long long> vp;
      pair<long long, long long> pp = rpg(ppt.first);
      for (int(i) = 1; (i) <= (int)(cnt); (i)++) {
        long long zd = rp[i].x * pp.second - rp[i].y * pp.first;
        vp.push_back(zd);
      }
      sort(vp.begin(), vp.end());
      bool ok = 1;
      for (int i = 1, j = cnt - 2; i <= j; i++, j--) {
        if (vp[i] + vp[j] != vp[0] + vp[cnt - 1]) {
          ok = 0;
          break;
        }
      }
      if (ok) ans++;
    }
  printf("%d\n", ans);
}
int main() {
  int t = 1;
  for (int(i) = 1; (i) <= (int)(t); (i)++) {
    fmain(i);
  }
  return 0;
}

### Prompt

Please provide a cpp coded solution to the problem described below:

You are given a set of n points on the plane. A line containing the origin is called good, if projection of the given set to this line forms a symmetric multiset of points. Find the total number of good lines.

Multiset is a set where equal elements are allowed.

Multiset is called symmetric, if there is a point P on the plane such that the multiset is [centrally symmetric](https://en.wikipedia.org/wiki/Point_reflection) in respect of point P.

Input

The first line contains a single integer n (1 ≤ n ≤ 2000) — the number of points in the set.

Each of the next n lines contains two integers xi and yi ( - 106 ≤ xi, yi ≤ 106) — the coordinates of the points. It is guaranteed that no two points coincide.

Output

If there are infinitely many good lines, print -1.

Otherwise, print single integer — the number of good lines.

Examples

Input

3
1 2
2 1
3 3


Output

3


Input

2
4 3
1 2


Output

-1

Note

Picture to the first sample test:

<image>

In the second sample, any line containing the origin is good.

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
bool debug = 0;
int n, m, k;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
string direc = "RDLU";
long long ln, lk, lm;
void etp(bool f = 0) {
  puts(f ? "YES" : "NO");
  exit(0);
}
void addmod(int &x, int y, int mod = 1000000007) {
  assert(y >= 0);
  x += y;
  if (x >= mod) x -= mod;
  assert(x >= 0 && x < mod);
}
void et() {
  puts("-1");
  exit(0);
}
long long fastPow(long long x, long long y, int mod = 1000000007) {
  long long ans = 1;
  while (y > 0) {
    if (y & 1) ans = (x * ans) % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return ans;
}
long long gcd1(long long x, long long y) {
  long long z = y;
  while (x % y != 0) {
    z = x % y;
    x = y;
    y = z;
  }
  return z;
}
struct Point {
  long long x, y;
  Point() {}
  Point(long long x, long long y) : x(x), y(y) {}
  long double abs() const { return hypot(x, y); }
  long double arg() const { return atan2(y, x); }
  Point operator*(double o) const { return Point(x * o, y * o); }
  Point operator+(const Point &o) const { return Point(x + o.x, y + o.y); }
  Point operator-(const Point &o) const { return Point(x - o.x, y - o.y); }
  bool operator<(const Point &o) const {
    return x < o.x - 1e-9 || (x < o.x + 1e-9 && y < o.y - 1e-9);
  }
  friend bool operator==(const Point &r1, const Point &r2) {
    return r1.x == r2.x && r1.y == r2.y;
  }
  Point scale(double o) const { return *this * (o / abs()); }
  Point rotY() const { return Point(-y, x); }
  Point rotX() const { return Point(y, -x); }
  Point div(long long z) const { return Point(x / z, y / z); }
  long long cross(Point b) const { return x * b.y - b.x * y; }
  long long dot(Point b) const { return x * b.x + y * b.y; }
  long double disToSeg(Point &a, Point &b) {
    return fabs(((*this) - a).cross(b - a) / (b - a).abs());
  }
  pair<long long, long long> getVec() {
    if (x == 0) return {0, 1};
    if (y == 0) return {1, 0};
    long long gg = gcd1(::abs(x), ::abs(y));
    long long px = x / gg, py = y / gg;
    if (px < 0) {
      px *= -1;
      py *= -1;
    }
    return {px, py};
  }
  void readin() { scanf("%lld%lld", &x, &y); }
};
Point p[2105], C, rp[2105];
int cnt, ans;
long long ttPs;
unordered_map<long long, int> mp;
bool vis[2105];
int M = 2e9;
long long gk(pair<long long, long long> pr) {
  if (pr.second < 0) return -pr.first * M + pr.second;
  return pr.first * M + pr.second;
}
pair<long long, long long> rpg(long long val) {
  int ok = 1;
  if (val < 0) {
    val *= -1;
    ok = -1;
  }
  long long y = val % M;
  return {(val - y) / M, y * ok};
}
void fmain(int ID) {
  scanf("%d", &n);
  if (n <= 2) et();
  C = Point(0, 0);
  debug = 0;
  for (int(i) = 1; (i) <= (int)(n); (i)++) {
    p[i].readin();
    if (n == 2000 && i == 1 && p[i].x == -3933) debug = 1;
    p[i] = p[i] * 2 * n;
    C = C + p[i];
  }
  C.x /= n;
  C.y /= n;
  ttPs = n / 2;
  for (int(i) = 1; (i) <= (int)(n); (i)++)
    if (!vis[i])
      for (int j = i + 1; j <= n; j++) {
        Point sc = (p[i] + p[j]).div(2);
        if (sc == C) {
          ttPs--;
          vis[i] = 1;
          vis[j] = 1;
          break;
        }
        Point pp = sc - C;
        mp[gk(pp.getVec())]++;
      }
  if (ttPs == 0) et();
  for (int(i) = 1; (i) <= (int)(n); (i)++)
    if (!vis[i]) rp[++cnt] = p[i];
  for (auto &ppt : mp)
    if (ppt.second >= ttPs) {
      vector<long long> vp;
      pair<long long, long long> pp = rpg(ppt.first);
      for (int(i) = 1; (i) <= (int)(cnt); (i)++) {
        long long zd = rp[i].x * pp.second - rp[i].y * pp.first;
        vp.push_back(zd);
      }
      sort(vp.begin(), vp.end());
      bool ok = 1;
      for (int i = 1, j = cnt - 2; i <= j; i++, j--) {
        if (vp[i] + vp[j] != vp[0] + vp[cnt - 1]) {
          ok = 0;
          break;
        }
      }
      if (ok) ans++;
    }
  printf("%d\n", ans);
}
int main() {
  int t = 1;
  for (int(i) = 1; (i) <= (int)(t); (i)++) {
    fmain(i);
  }
  return 0;
}

```