#include <bits/stdc++.h>
using namespace std;
template <class _T_>
void read(_T_& d) {
  d = 0;
  int f = 1;
  char c = getchar();
  for (; c < '0' || c > '9'; c = getchar())
    if (c == '-') f *= -1;
  for (; c >= '0' && c <= '9'; c = getchar()) d = d * 10 + c - '0';
  d *= f;
}
const double eps = 1e-9;
struct Node {
  double x, y;
} p[2205], rt, P;
Node operator+(Node A, Node B) { return (Node){A.x + B.x, A.y + B.y}; }
Node operator-(Node A, Node B) { return (Node){A.x - B.x, A.y - B.y}; }
Node operator*(Node A, double B) { return (Node){A.x * B, A.y * B}; }
Node operator/(Node A, double B) { return (Node){A.x / B, A.y / B}; }
double operator*(Node A, Node B) { return A.x * B.x + A.y * B.y; }
bool operator==(Node A, Node B) { return A.x == B.x && A.y == B.y; }
int res, n, a;
pair<double, int> PP[2205];
bool Doit(int x) {
  P = (p[a] + p[x]) * .5;
  Node var = rt - P;
  var = (Node){var.y, -var.x};
  for (int i = 1; i <= n; ++i) {
    PP[i] = make_pair(var * p[i], i);
  }
  sort(PP + 1, PP + n + 1);
  int G = 0;
  for (int i = 1; i <= n; ++i) {
    if (PP[i].second == x) G += i;
    if (PP[i].second == a) G += i;
  }
  if (G != n + 1) return 0;
  for (int i = 1; i <= n; ++i) {
    if (abs(PP[i].first + PP[n - i + 1].first - PP[1].first - PP[n].first) >
        eps)
      return 0;
  }
  return 1;
}
int main() {
  read(n);
  res = 0;
  for (int i = 1; i <= n; ++i) {
    scanf("%lf%lf", &p[i].x, &p[i].y);
    rt = rt + p[i];
  }
  rt = rt / n;
  for (int i = 1; i <= n; ++i) {
    int A = 1;
    for (int j = 1; j <= n; ++j)
      if (p[i] + p[j] == rt + rt) A = 0;
    if (A) {
      a = i;
      goto Turtle;
    }
  }
  return puts("-1"), 0;
Turtle:
  for (int i = 1; i <= n; ++i)
    if (Doit(i)) ++res;
  printf("%d\n", res);
  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;
template <class _T_>
void read(_T_& d) {
  d = 0;
  int f = 1;
  char c = getchar();
  for (; c < '0' || c > '9'; c = getchar())
    if (c == '-') f *= -1;
  for (; c >= '0' && c <= '9'; c = getchar()) d = d * 10 + c - '0';
  d *= f;
}
const double eps = 1e-9;
struct Node {
  double x, y;
} p[2205], rt, P;
Node operator+(Node A, Node B) { return (Node){A.x + B.x, A.y + B.y}; }
Node operator-(Node A, Node B) { return (Node){A.x - B.x, A.y - B.y}; }
Node operator*(Node A, double B) { return (Node){A.x * B, A.y * B}; }
Node operator/(Node A, double B) { return (Node){A.x / B, A.y / B}; }
double operator*(Node A, Node B) { return A.x * B.x + A.y * B.y; }
bool operator==(Node A, Node B) { return A.x == B.x && A.y == B.y; }
int res, n, a;
pair<double, int> PP[2205];
bool Doit(int x) {
  P = (p[a] + p[x]) * .5;
  Node var = rt - P;
  var = (Node){var.y, -var.x};
  for (int i = 1; i <= n; ++i) {
    PP[i] = make_pair(var * p[i], i);
  }
  sort(PP + 1, PP + n + 1);
  int G = 0;
  for (int i = 1; i <= n; ++i) {
    if (PP[i].second == x) G += i;
    if (PP[i].second == a) G += i;
  }
  if (G != n + 1) return 0;
  for (int i = 1; i <= n; ++i) {
    if (abs(PP[i].first + PP[n - i + 1].first - PP[1].first - PP[n].first) >
        eps)
      return 0;
  }
  return 1;
}
int main() {
  read(n);
  res = 0;
  for (int i = 1; i <= n; ++i) {
    scanf("%lf%lf", &p[i].x, &p[i].y);
    rt = rt + p[i];
  }
  rt = rt / n;
  for (int i = 1; i <= n; ++i) {
    int A = 1;
    for (int j = 1; j <= n; ++j)
      if (p[i] + p[j] == rt + rt) A = 0;
    if (A) {
      a = i;
      goto Turtle;
    }
  }
  return puts("-1"), 0;
Turtle:
  for (int i = 1; i <= n; ++i)
    if (Doit(i)) ++res;
  printf("%d\n", res);
  return 0;
}

```