#include <bits/stdc++.h>
using namespace std;
inline int Read() {
  int x = 0, f = 1, c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') f = -1;
  for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
  return x * f;
}
const int MAXN = 2005;
const long double eps = 1e-9;
struct Point {
  long double x, y;
  Point(long double _x = 0, long double _y = 0) { x = _x, y = _y; }
  Point operator+(const Point &b) const { return Point(x + b.x, y + b.y); }
  Point operator-(const Point &b) const { return Point(x - b.x, y - b.y); }
  Point operator*(const long double &b) const { return Point(x * b, y * b); }
  bool operator==(const Point &b) const { return x == b.x && y == b.y; }
  long double operator*(const Point &b) const { return x * b.y - y * b.x; }
  inline long double Len() { return sqrt(x * x + y * y); }
} sum, p[MAXN];
vector<Point> ans;
bool b[MAXN];
int n;
inline Point Get(Point p) {
  long double l = p.Len();
  return Point(p.x / l, p.y / l);
}
int main() {
  n = Read();
  for (int i = 1; i <= n; i++)
    p[i].x = Read(), p[i].y = Read(), sum = sum + p[i];
  for (int i = 1; i <= n; i++)
    for (int j = i; j <= n; j++)
      if ((p[i] + p[j]) * n == sum * 2) b[i] = 1, b[j] = 1;
  sum.x /= n, sum.y /= n;
  int lst_n = n;
  n = 0;
  for (int i = 1; i <= lst_n; i++)
    if (!b[i]) p[++n] = p[i];
  if (!n) return puts("-1"), 0;
  for (int i = 1; i <= n; i++) p[i] = p[i] - sum;
  for (int i = 1; i <= n; i++) {
    Point e = Get(p[1] + p[i]);
    vector<long double> a, b;
    for (int j = 1; j <= n; j++) {
      long double v = p[j] * e;
      if (fabs(v) > eps)
        if (v > 0)
          a.push_back(v);
        else
          b.push_back(-v);
    }
    if (a.size() != b.size()) continue;
    sort(a.begin(), a.end());
    sort(b.begin(), b.end());
    bool flg = true;
    for (int j = 0; j < a.size() && flg; j++)
      if (fabs(a[j] - b[j]) > eps) flg = false;
    if (flg) ans.push_back(e);
  }
  int ret = 0;
  for (int i = 0; i < ans.size(); i++) {
    bool flg = true;
    for (int j = 0; j < i && flg; j++)
      if (fabs((ans[i] + ans[j]).Len()) < eps ||
          fabs((ans[i] - ans[j]).Len()) < eps)
        flg = false;
    if (flg) ret++;
  }
  return printf("%d\n", ret), 0;
}

### Prompt

Construct a cpp code solution to the problem outlined:

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;
inline int Read() {
  int x = 0, f = 1, c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') f = -1;
  for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
  return x * f;
}
const int MAXN = 2005;
const long double eps = 1e-9;
struct Point {
  long double x, y;
  Point(long double _x = 0, long double _y = 0) { x = _x, y = _y; }
  Point operator+(const Point &b) const { return Point(x + b.x, y + b.y); }
  Point operator-(const Point &b) const { return Point(x - b.x, y - b.y); }
  Point operator*(const long double &b) const { return Point(x * b, y * b); }
  bool operator==(const Point &b) const { return x == b.x && y == b.y; }
  long double operator*(const Point &b) const { return x * b.y - y * b.x; }
  inline long double Len() { return sqrt(x * x + y * y); }
} sum, p[MAXN];
vector<Point> ans;
bool b[MAXN];
int n;
inline Point Get(Point p) {
  long double l = p.Len();
  return Point(p.x / l, p.y / l);
}
int main() {
  n = Read();
  for (int i = 1; i <= n; i++)
    p[i].x = Read(), p[i].y = Read(), sum = sum + p[i];
  for (int i = 1; i <= n; i++)
    for (int j = i; j <= n; j++)
      if ((p[i] + p[j]) * n == sum * 2) b[i] = 1, b[j] = 1;
  sum.x /= n, sum.y /= n;
  int lst_n = n;
  n = 0;
  for (int i = 1; i <= lst_n; i++)
    if (!b[i]) p[++n] = p[i];
  if (!n) return puts("-1"), 0;
  for (int i = 1; i <= n; i++) p[i] = p[i] - sum;
  for (int i = 1; i <= n; i++) {
    Point e = Get(p[1] + p[i]);
    vector<long double> a, b;
    for (int j = 1; j <= n; j++) {
      long double v = p[j] * e;
      if (fabs(v) > eps)
        if (v > 0)
          a.push_back(v);
        else
          b.push_back(-v);
    }
    if (a.size() != b.size()) continue;
    sort(a.begin(), a.end());
    sort(b.begin(), b.end());
    bool flg = true;
    for (int j = 0; j < a.size() && flg; j++)
      if (fabs(a[j] - b[j]) > eps) flg = false;
    if (flg) ans.push_back(e);
  }
  int ret = 0;
  for (int i = 0; i < ans.size(); i++) {
    bool flg = true;
    for (int j = 0; j < i && flg; j++)
      if (fabs((ans[i] + ans[j]).Len()) < eps ||
          fabs((ans[i] - ans[j]).Len()) < eps)
        flg = false;
    if (flg) ret++;
  }
  return printf("%d\n", ret), 0;
}

```