#include <bits/stdc++.h>
using namespace std;
char getc() {
  char c = getchar();
  while ((c < 'A' || c > 'Z') && (c < 'a' || c > 'z') && (c < '0' || c > '9'))
    c = getchar();
  return c;
}
int gcd(int n, int m) { return m == 0 ? n : gcd(m, n % m); }
int read() {
  int x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9')
    x = (x << 1) + (x << 3) + (c ^ 48), c = getchar();
  return x * f;
}
const long double eps = 1E-11;
const long double PI = 3.1415926535897932;
int n, ans;
long double b[2010];
bool flag[2010];
struct point {
  long double x, y;
  point operator+(const point& a) const { return (point){x + a.x, y + a.y}; }
  point operator-(const point& a) const { return (point){x - a.x, y - a.y}; }
  point operator*(const long double& a) const { return (point){a * x, a * y}; }
  long double operator*(const point& a) const { return x * a.y - y * a.x; }
  long double operator^(const point& a) const { return x * a.x + y * a.y; }
  long double len() { return sqrt(x * x + y * y); }
  bool iszero() { return len() < eps; }
  point rotate(long double alpha) {
    return (point){x * cos(alpha) + y * sin(alpha),
                   x * sin(alpha) - y * cos(alpha)};
  }
} a[2010], c[2010], P;
signed main() {
  n = read();
  for (int i = 1; i <= n; i++) a[i].x = read(), a[i].y = read(), P = P + a[i];
  P = P * (1.0 / n);
  int cnt = 0, t = 0;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= i; j++)
      if ((a[i] + a[j] - P * 2).iszero()) {
        flag[i] = flag[j] = 1;
        break;
      }
  for (int i = 1; i <= n; i++)
    if (!flag[i]) a[++t] = a[i];
  n = t;
  t = 0;
  if (!n) {
    cout << -1;
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    point Q = (a[i] + a[1]) * 0.5 - P;
    long double w = Q.len();
    if (fabs(w) < eps) {
      cnt++;
      continue;
    }
    w = 1.0 / w;
    Q = Q * w;
    for (int j = 1; j <= n; j++) b[j] = a[j] * Q;
    sort(b + 1, b + n + 1);
    bool flag = 0;
    long double mid = P * Q;
    for (int j = 1; j <= n; j++)
      if (fabs(b[j] + b[n - j + 1] - mid * 2) > eps) {
        flag = 1;
        break;
      }
    if (!flag) c[++t] = Q;
  }
  memset(flag, 0, sizeof(flag));
  for (int i = 1; i <= t; i++) {
    flag[i] = 1;
    for (int j = 1; j < i; j++)
      if (flag[j] && fabs(c[i] * c[j]) < eps) {
        flag[i] = 0;
        break;
      }
    if (flag[i]) ans++;
  }
  cout << ans;
  return 0;
}

### Prompt

Develop a solution in cpp 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;
char getc() {
  char c = getchar();
  while ((c < 'A' || c > 'Z') && (c < 'a' || c > 'z') && (c < '0' || c > '9'))
    c = getchar();
  return c;
}
int gcd(int n, int m) { return m == 0 ? n : gcd(m, n % m); }
int read() {
  int x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9')
    x = (x << 1) + (x << 3) + (c ^ 48), c = getchar();
  return x * f;
}
const long double eps = 1E-11;
const long double PI = 3.1415926535897932;
int n, ans;
long double b[2010];
bool flag[2010];
struct point {
  long double x, y;
  point operator+(const point& a) const { return (point){x + a.x, y + a.y}; }
  point operator-(const point& a) const { return (point){x - a.x, y - a.y}; }
  point operator*(const long double& a) const { return (point){a * x, a * y}; }
  long double operator*(const point& a) const { return x * a.y - y * a.x; }
  long double operator^(const point& a) const { return x * a.x + y * a.y; }
  long double len() { return sqrt(x * x + y * y); }
  bool iszero() { return len() < eps; }
  point rotate(long double alpha) {
    return (point){x * cos(alpha) + y * sin(alpha),
                   x * sin(alpha) - y * cos(alpha)};
  }
} a[2010], c[2010], P;
signed main() {
  n = read();
  for (int i = 1; i <= n; i++) a[i].x = read(), a[i].y = read(), P = P + a[i];
  P = P * (1.0 / n);
  int cnt = 0, t = 0;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= i; j++)
      if ((a[i] + a[j] - P * 2).iszero()) {
        flag[i] = flag[j] = 1;
        break;
      }
  for (int i = 1; i <= n; i++)
    if (!flag[i]) a[++t] = a[i];
  n = t;
  t = 0;
  if (!n) {
    cout << -1;
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    point Q = (a[i] + a[1]) * 0.5 - P;
    long double w = Q.len();
    if (fabs(w) < eps) {
      cnt++;
      continue;
    }
    w = 1.0 / w;
    Q = Q * w;
    for (int j = 1; j <= n; j++) b[j] = a[j] * Q;
    sort(b + 1, b + n + 1);
    bool flag = 0;
    long double mid = P * Q;
    for (int j = 1; j <= n; j++)
      if (fabs(b[j] + b[n - j + 1] - mid * 2) > eps) {
        flag = 1;
        break;
      }
    if (!flag) c[++t] = Q;
  }
  memset(flag, 0, sizeof(flag));
  for (int i = 1; i <= t; i++) {
    flag[i] = 1;
    for (int j = 1; j < i; j++)
      if (flag[j] && fabs(c[i] * c[j]) < eps) {
        flag[i] = 0;
        break;
      }
    if (flag[i]) ans++;
  }
  cout << ans;
  return 0;
}

```