#include <bits/stdc++.h>
using namespace std;
complex<double> p[2010];
bool b[2010];
double dot(complex<double> a, complex<double> b) {
  return (conj(a) * b).real();
}
double cross(complex<double> a, complex<double> b) {
  return (conj(a) * b).imag();
}
ostream& operator<<(ostream& os, complex<double> a) {
  os << a.real() << ' ' << a.imag();
  return os;
}
int main() {
  int n, i, j;
  complex<double> centre;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    p[i] = complex<double>(x, y);
    centre += p[i];
  }
  centre /= n;
  for (i = 1; i <= n; i++)
    for (j = 1; j <= n; j++)
      if (b[i] | b[j] == false && (p[i] + p[j]) / 2.0 == centre)
        b[i] = b[j] = true;
  for (i = 1; i <= n; i++)
    if (b[i] == false) break;
  if (i == n + 1) {
    printf("-1\n");
    return 0;
  }
  int x = i, ans = 0;
  for (i = x; i <= n; i++) {
    if (b[i]) continue;
    complex<double> m = (p[i] + p[x]) / 2.0;
    complex<double> lv =
        complex<double>((m - centre).imag(), (centre - m).real());
    for (j = x; j < i; j++)
      if (!b[j] && abs(cross(m - centre, (p[j] + p[x]) / 2.0 - centre)) < 1e-9)
        break;
    if (j < i) continue;
    vector<double> v;
    for (j = 1; j <= n; j++) {
      if (b[j]) continue;
      v.push_back(dot(p[j] - centre, lv));
    }
    sort(v.begin(), v.end());
    for (j = 0; j < v.size(); j++)
      if (abs(v[j] + v[v.size() - 1 - j]) > 1e-9) break;
    ans += j == v.size();
  }
  printf("%d\n", ans);
  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;
complex<double> p[2010];
bool b[2010];
double dot(complex<double> a, complex<double> b) {
  return (conj(a) * b).real();
}
double cross(complex<double> a, complex<double> b) {
  return (conj(a) * b).imag();
}
ostream& operator<<(ostream& os, complex<double> a) {
  os << a.real() << ' ' << a.imag();
  return os;
}
int main() {
  int n, i, j;
  complex<double> centre;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    p[i] = complex<double>(x, y);
    centre += p[i];
  }
  centre /= n;
  for (i = 1; i <= n; i++)
    for (j = 1; j <= n; j++)
      if (b[i] | b[j] == false && (p[i] + p[j]) / 2.0 == centre)
        b[i] = b[j] = true;
  for (i = 1; i <= n; i++)
    if (b[i] == false) break;
  if (i == n + 1) {
    printf("-1\n");
    return 0;
  }
  int x = i, ans = 0;
  for (i = x; i <= n; i++) {
    if (b[i]) continue;
    complex<double> m = (p[i] + p[x]) / 2.0;
    complex<double> lv =
        complex<double>((m - centre).imag(), (centre - m).real());
    for (j = x; j < i; j++)
      if (!b[j] && abs(cross(m - centre, (p[j] + p[x]) / 2.0 - centre)) < 1e-9)
        break;
    if (j < i) continue;
    vector<double> v;
    for (j = 1; j <= n; j++) {
      if (b[j]) continue;
      v.push_back(dot(p[j] - centre, lv));
    }
    sort(v.begin(), v.end());
    for (j = 0; j < v.size(); j++)
      if (abs(v[j] + v[v.size() - 1 - j]) > 1e-9) break;
    ans += j == v.size();
  }
  printf("%d\n", ans);
  return 0;
}

```