#include <bits/stdc++.h>
using namespace std;
const long double eps = 1e-8;
const int N = 2010;
int n, m;
int sign(long double x) {
  if (fabs(x) < eps) return 0;
  return x < 0 ? -1 : 1;
}
bool dcmp(long double x, long double y) { return sign(x - y) == 0; }
struct P {
  long double x, y;
  P() {}
  P(long double x, long double y) : x(x), y(y) {}
  P operator+(P p) { return P(x + p.x, y + p.y); }
  P operator-(P p) { return P(x - p.x, y - p.y); }
  P operator*(long double k) { return P(x * k, y * k); }
  P operator/(long double k) { return P(x / k, y / k); }
  bool operator==(P p) { return dcmp(x, p.x) && dcmp(y, p.y); }
  long double det(P p) { return x * p.y - y * p.x; }
  long double dist() { return sqrt(x * x + y * y); }
  P unit() { return *this / dist(); }
};
P b[N], p[N], cm;
int cnt, tot;
long double a[N];
int vis[N];
int ans;
bool cmp(P p1, P p2) {
  return sign(p1.x - p2.x) == -1 ||
         (sign(p1.x - p2.x) == 0 && sign(p1.y - p2.y) == -1);
}
int main() {
  int i, j;
  P now;
  int ok;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) cin >> p[i].x >> p[i].y;
  for (i = 1; i <= n; i++) cm = cm + p[i];
  cm = cm / (long double)n;
  for (i = 1; i <= n; i++)
    if (!vis[i]) {
      for (j = i + 1; j <= n; j++)
        if (!vis[j] && !vis[i]) {
          if (cm * 2 == p[i] + p[j]) {
            vis[i] = 1;
            vis[j] = 1;
            break;
          }
        }
    }
  for (i = 1; i <= n; i++)
    if (!vis[i] && p[i] == cm) {
      vis[i] = 1;
      break;
    }
  for (i = 1; i <= n; i++)
    if (!vis[i]) p[++m] = p[i];
  n = m;
  if (n == 0) {
    printf("-1\n");
    return 0;
  }
  for (i = 2; i <= n; i++) {
    ok = 1;
    now = (p[1] + p[i]) / (long double)2;
    cnt = 0;
    for (j = 1; j <= n; j++) a[++cnt] = (now - cm).det(p[j] - cm);
    sort(a + 1, a + 1 + cnt);
    for (j = 1; j <= cnt / 2 + 1; j++)
      if (sign(a[j] + a[cnt - j + 1]) != 0) ok = 0;
    if (ok) b[++tot] = now - cm;
  }
  if (n & 1) {
    ok = 1;
    now = p[1];
    cnt = 0;
    for (j = 1; j <= n; j++) a[++cnt] = (now - cm).det(p[j] - cm);
    sort(a + 1, a + 1 + cnt);
    for (j = 1; j <= cnt / 2 + 1; j++)
      if (sign(a[j] + a[cnt - j + 1]) != 0) ok = 0;
    if (ok) b[++tot] = now - cm;
  }
  for (i = 1; i <= tot; i++)
    if (sign(b[i].x) == -1 || (sign(b[i].x) == 0 && sign(b[i].y) == -1)) {
      b[i] = P(-b[i].x, -b[i].y);
    }
  for (i = 1; i <= tot; i++) b[i] = b[i].unit();
  sort(b + 1, b + 1 + tot, cmp);
  if (tot)
    ans = 1;
  else
    ans = 0;
  for (i = 2; i <= tot; i++)
    if (!(b[i] == b[i - 1])) ans++;
  printf("%d\n", ans);
}

### Prompt

Generate a cpp solution to the following problem:

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;
const long double eps = 1e-8;
const int N = 2010;
int n, m;
int sign(long double x) {
  if (fabs(x) < eps) return 0;
  return x < 0 ? -1 : 1;
}
bool dcmp(long double x, long double y) { return sign(x - y) == 0; }
struct P {
  long double x, y;
  P() {}
  P(long double x, long double y) : x(x), y(y) {}
  P operator+(P p) { return P(x + p.x, y + p.y); }
  P operator-(P p) { return P(x - p.x, y - p.y); }
  P operator*(long double k) { return P(x * k, y * k); }
  P operator/(long double k) { return P(x / k, y / k); }
  bool operator==(P p) { return dcmp(x, p.x) && dcmp(y, p.y); }
  long double det(P p) { return x * p.y - y * p.x; }
  long double dist() { return sqrt(x * x + y * y); }
  P unit() { return *this / dist(); }
};
P b[N], p[N], cm;
int cnt, tot;
long double a[N];
int vis[N];
int ans;
bool cmp(P p1, P p2) {
  return sign(p1.x - p2.x) == -1 ||
         (sign(p1.x - p2.x) == 0 && sign(p1.y - p2.y) == -1);
}
int main() {
  int i, j;
  P now;
  int ok;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) cin >> p[i].x >> p[i].y;
  for (i = 1; i <= n; i++) cm = cm + p[i];
  cm = cm / (long double)n;
  for (i = 1; i <= n; i++)
    if (!vis[i]) {
      for (j = i + 1; j <= n; j++)
        if (!vis[j] && !vis[i]) {
          if (cm * 2 == p[i] + p[j]) {
            vis[i] = 1;
            vis[j] = 1;
            break;
          }
        }
    }
  for (i = 1; i <= n; i++)
    if (!vis[i] && p[i] == cm) {
      vis[i] = 1;
      break;
    }
  for (i = 1; i <= n; i++)
    if (!vis[i]) p[++m] = p[i];
  n = m;
  if (n == 0) {
    printf("-1\n");
    return 0;
  }
  for (i = 2; i <= n; i++) {
    ok = 1;
    now = (p[1] + p[i]) / (long double)2;
    cnt = 0;
    for (j = 1; j <= n; j++) a[++cnt] = (now - cm).det(p[j] - cm);
    sort(a + 1, a + 1 + cnt);
    for (j = 1; j <= cnt / 2 + 1; j++)
      if (sign(a[j] + a[cnt - j + 1]) != 0) ok = 0;
    if (ok) b[++tot] = now - cm;
  }
  if (n & 1) {
    ok = 1;
    now = p[1];
    cnt = 0;
    for (j = 1; j <= n; j++) a[++cnt] = (now - cm).det(p[j] - cm);
    sort(a + 1, a + 1 + cnt);
    for (j = 1; j <= cnt / 2 + 1; j++)
      if (sign(a[j] + a[cnt - j + 1]) != 0) ok = 0;
    if (ok) b[++tot] = now - cm;
  }
  for (i = 1; i <= tot; i++)
    if (sign(b[i].x) == -1 || (sign(b[i].x) == 0 && sign(b[i].y) == -1)) {
      b[i] = P(-b[i].x, -b[i].y);
    }
  for (i = 1; i <= tot; i++) b[i] = b[i].unit();
  sort(b + 1, b + 1 + tot, cmp);
  if (tot)
    ans = 1;
  else
    ans = 0;
  for (i = 2; i <= tot; i++)
    if (!(b[i] == b[i - 1])) ans++;
  printf("%d\n", ans);
}

```