#include <bits/stdc++.h>
using namespace std;
const int N = 2005;
int read() {
  char ch;
  int n = 0, p = 1;
  for (ch = getchar(); ch < '0' || '9' < ch; ch = getchar())
    if (ch == '-') p = -1;
  for (; '0' <= ch && ch <= '9'; ch = getchar()) n = n * 10 + ch - '0';
  return n * p;
}
struct dot {
  double x, y;
  friend dot operator+(dot a, dot b) { return (dot){a.x + b.x, a.y + b.y}; }
  friend dot operator-(dot a, dot b) { return (dot){a.x - b.x, a.y - b.y}; }
  friend dot operator*(double k, dot a) { return (dot){k * a.x, k * a.y}; }
  friend double operator^(dot a, dot b) { return a.x * b.y - a.y * b.x; }
  friend bool operator==(dot a, dot b) { return a.x == b.x && a.y == b.y; }
} a[N], b[N], G;
int n, m, ans;
bool bz[N];
double d[N];
map<long long, int> cnt;
int main() {
  G = (dot){0, 0};
  n = read();
  for (int i = (1); i <= (n); ++i)
    a[i].x = read(), a[i].y = read(), G = G + a[i];
  G = (1.0 / n) * G;
  memset(bz, 0, sizeof(bz));
  for (int i = (1); i <= (n - 1); ++i)
    for (int j = (i + 1); j <= (n); ++j)
      if (abs(a[i].x + a[j].x - 2 * G.x) <= 1e-7 &&
          abs(a[i].y + a[j].y - 2 * G.y) <= 1e-7)
        bz[i] = bz[j] = 1;
  m = 0;
  for (int i = (1); i <= (n); ++i)
    if (!bz[i]) b[++m] = a[i];
  if (m <= 2) return puts("-1"), 0;
  cnt.clear();
  int ans = 0;
  for (int i = (1); i <= (m - 1); ++i)
    for (int j = (i + 1); j <= (m); ++j) {
      dot p = 0.5 * (b[i] + b[j]);
      double angle = (p.x < G.x || (p.x == G.x && p.y < G.y))
                         ? atan2(G.y - p.y, G.x - p.x)
                         : atan2(p.y - G.y, p.x - G.x);
      long long val = (long long)((angle * 1e7) + 0.5);
      if (cnt[val] == -1) continue;
      if (++cnt[val] >= m / 2) {
        for (int k = (1); k <= (m); ++k) d[k] = (p - G) ^ (b[k] - G);
        sort(d + 1, d + m + 1);
        bool ok = 1;
        for (int i = (1); i <= (m / 2); ++i)
          if (abs(d[i] + d[m - i + 1]) > 1e-7) {
            ok = 0;
            break;
          }
        ans += ok;
        cnt[val] = -1;
      }
    }
  printf("%d\n", ans);
  return 0;
}

### Prompt

Your challenge is to write 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 int N = 2005;
int read() {
  char ch;
  int n = 0, p = 1;
  for (ch = getchar(); ch < '0' || '9' < ch; ch = getchar())
    if (ch == '-') p = -1;
  for (; '0' <= ch && ch <= '9'; ch = getchar()) n = n * 10 + ch - '0';
  return n * p;
}
struct dot {
  double x, y;
  friend dot operator+(dot a, dot b) { return (dot){a.x + b.x, a.y + b.y}; }
  friend dot operator-(dot a, dot b) { return (dot){a.x - b.x, a.y - b.y}; }
  friend dot operator*(double k, dot a) { return (dot){k * a.x, k * a.y}; }
  friend double operator^(dot a, dot b) { return a.x * b.y - a.y * b.x; }
  friend bool operator==(dot a, dot b) { return a.x == b.x && a.y == b.y; }
} a[N], b[N], G;
int n, m, ans;
bool bz[N];
double d[N];
map<long long, int> cnt;
int main() {
  G = (dot){0, 0};
  n = read();
  for (int i = (1); i <= (n); ++i)
    a[i].x = read(), a[i].y = read(), G = G + a[i];
  G = (1.0 / n) * G;
  memset(bz, 0, sizeof(bz));
  for (int i = (1); i <= (n - 1); ++i)
    for (int j = (i + 1); j <= (n); ++j)
      if (abs(a[i].x + a[j].x - 2 * G.x) <= 1e-7 &&
          abs(a[i].y + a[j].y - 2 * G.y) <= 1e-7)
        bz[i] = bz[j] = 1;
  m = 0;
  for (int i = (1); i <= (n); ++i)
    if (!bz[i]) b[++m] = a[i];
  if (m <= 2) return puts("-1"), 0;
  cnt.clear();
  int ans = 0;
  for (int i = (1); i <= (m - 1); ++i)
    for (int j = (i + 1); j <= (m); ++j) {
      dot p = 0.5 * (b[i] + b[j]);
      double angle = (p.x < G.x || (p.x == G.x && p.y < G.y))
                         ? atan2(G.y - p.y, G.x - p.x)
                         : atan2(p.y - G.y, p.x - G.x);
      long long val = (long long)((angle * 1e7) + 0.5);
      if (cnt[val] == -1) continue;
      if (++cnt[val] >= m / 2) {
        for (int k = (1); k <= (m); ++k) d[k] = (p - G) ^ (b[k] - G);
        sort(d + 1, d + m + 1);
        bool ok = 1;
        for (int i = (1); i <= (m / 2); ++i)
          if (abs(d[i] + d[m - i + 1]) > 1e-7) {
            ok = 0;
            break;
          }
        ans += ok;
        cnt[val] = -1;
      }
    }
  printf("%d\n", ans);
  return 0;
}

```