#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-6;
struct node {
  double x, y;
  friend node operator+(node a, node b) { return (node){a.x + b.x, a.y + b.y}; }
  friend node operator-(node a, node b) { return (node){a.x - b.x, a.y - b.y}; }
  friend double operator*(node a, node b) { return a.x * b.y - a.y * b.x; }
  friend bool operator==(node a, node b) {
    return fabs(a.x - b.x) < eps && fabs(a.y - b.y) < eps;
  }
} a[2010], M, b[2010];
node mid(node a, node b) { return (node){(a.x + b.x) / 2, (a.y + b.y) / 2}; }
int n, id[2010], num;
double len[2010];
bool d[2010], ans[2010];
bool cmp1(int x, int y) { return len[x] < len[y]; }
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%lf%lf", &a[i].x, &a[i].y);
    M.x += a[i].x;
    M.y += a[i].y;
  }
  M.x /= n;
  M.y /= n;
  for (int i = 1; i <= n; i++)
    if (!d[i]) {
      if (a[i] == M) {
        d[i] = 1;
        continue;
      }
      for (int j = 1; j < i; j++)
        if (!d[j] && mid(a[i], a[j]) == M) d[i] = d[j] = 1;
    }
  int tmp = 0;
  for (int i = 1; i <= n; i++)
    if (!d[i]) b[++tmp] = a[i];
  if (!tmp) {
    puts("-1");
    return 0;
  }
  swap(a, b);
  n = tmp;
  for (int i = 1; i <= n; i++) b[i] = M - mid(a[i], a[1]);
  for (int i = 1, j; i <= n; i++) {
    for (int j = 1; j <= n; j++) len[j] = b[i] * (a[j] - M), id[j] = j;
    sort(id + 1, id + n + 1, cmp1);
    bool ok = 1;
    for (int j = 1; j <= (n + 1) / 2; j++)
      if (abs(len[id[j]] + len[id[n - j + 1]]) > eps) {
        ok = 0;
        break;
      }
    if (ok) ans[i] = 1, num++;
  }
  for (int i = 1; i <= n; i++)
    if (ans[i])
      for (int j = 1; j < i; j++)
        if (ans[j] && fabs(b[i] * b[j]) < eps) {
          num--;
          break;
        }
  printf("%d", num);
  return 0;
}

### 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 double eps = 1e-6;
struct node {
  double x, y;
  friend node operator+(node a, node b) { return (node){a.x + b.x, a.y + b.y}; }
  friend node operator-(node a, node b) { return (node){a.x - b.x, a.y - b.y}; }
  friend double operator*(node a, node b) { return a.x * b.y - a.y * b.x; }
  friend bool operator==(node a, node b) {
    return fabs(a.x - b.x) < eps && fabs(a.y - b.y) < eps;
  }
} a[2010], M, b[2010];
node mid(node a, node b) { return (node){(a.x + b.x) / 2, (a.y + b.y) / 2}; }
int n, id[2010], num;
double len[2010];
bool d[2010], ans[2010];
bool cmp1(int x, int y) { return len[x] < len[y]; }
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%lf%lf", &a[i].x, &a[i].y);
    M.x += a[i].x;
    M.y += a[i].y;
  }
  M.x /= n;
  M.y /= n;
  for (int i = 1; i <= n; i++)
    if (!d[i]) {
      if (a[i] == M) {
        d[i] = 1;
        continue;
      }
      for (int j = 1; j < i; j++)
        if (!d[j] && mid(a[i], a[j]) == M) d[i] = d[j] = 1;
    }
  int tmp = 0;
  for (int i = 1; i <= n; i++)
    if (!d[i]) b[++tmp] = a[i];
  if (!tmp) {
    puts("-1");
    return 0;
  }
  swap(a, b);
  n = tmp;
  for (int i = 1; i <= n; i++) b[i] = M - mid(a[i], a[1]);
  for (int i = 1, j; i <= n; i++) {
    for (int j = 1; j <= n; j++) len[j] = b[i] * (a[j] - M), id[j] = j;
    sort(id + 1, id + n + 1, cmp1);
    bool ok = 1;
    for (int j = 1; j <= (n + 1) / 2; j++)
      if (abs(len[id[j]] + len[id[n - j + 1]]) > eps) {
        ok = 0;
        break;
      }
    if (ok) ans[i] = 1, num++;
  }
  for (int i = 1; i <= n; i++)
    if (ans[i])
      for (int j = 1; j < i; j++)
        if (ans[j] && fabs(b[i] * b[j]) < eps) {
          num--;
          break;
        }
  printf("%d", num);
  return 0;
}

```