#include <bits/stdc++.h>
long long mod = 1000000007;
using namespace std;
int n;
int x[113123];
int y[123123];
map<pair<double, double>, int> M;
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= mod;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
int main() {
  int i, j, fl, test;
  double x1, y1;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d%d", &x[i], &y[i]);
  }
  for (i = 0; i < n - 1; i++) {
    for (j = i + 1; j < n; j++) {
      x1 = (x[i] + x[j]) / 2.0;
      y1 = (y[i] + y[j]) / 2.0;
      if (M.find(make_pair(x1, y1)) == M.end())
        M[make_pair(x1, y1)] = 1;
      else
        M[make_pair(x1, y1)] += 1;
    }
  }
  long long ans = 0;
  for (i = 0; i < n - 1; i++) {
    for (j = i + 1; j < n; j++) {
      x1 = (x[i] + x[j]) / 2.0;
      y1 = (y[i] + y[j]) / 2.0;
      if (M.find(make_pair(x1, y1)) == M.end() || M[make_pair(x1, y1)] <= 1)
        continue;
      ans += (M[make_pair(x1, y1)]) * (M[make_pair(x1, y1)] - 1) / 2;
      M[make_pair(x1, y1)] = 0;
    }
  }
  printf("%lld\n", ans);
  return 0;
}

### Prompt

Please provide a Cpp coded solution to the problem described below:

You are given n points on a plane. All the points are distinct and no three of them lie on the same line. Find the number of parallelograms with the vertices at the given points.

Input

The first line of the input contains integer n (1 ≤ n ≤ 2000) — the number of points.

Each of the next n lines contains two integers (xi, yi) (0 ≤ xi, yi ≤ 109) — the coordinates of the i-th point.

Output

Print the only integer c — the number of parallelograms with the vertices at the given points.

Example

Input

4
0 1
1 0
1 1
2 0


Output

1

### Response

```cpp
#include <bits/stdc++.h>
long long mod = 1000000007;
using namespace std;
int n;
int x[113123];
int y[123123];
map<pair<double, double>, int> M;
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= mod;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
int main() {
  int i, j, fl, test;
  double x1, y1;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d%d", &x[i], &y[i]);
  }
  for (i = 0; i < n - 1; i++) {
    for (j = i + 1; j < n; j++) {
      x1 = (x[i] + x[j]) / 2.0;
      y1 = (y[i] + y[j]) / 2.0;
      if (M.find(make_pair(x1, y1)) == M.end())
        M[make_pair(x1, y1)] = 1;
      else
        M[make_pair(x1, y1)] += 1;
    }
  }
  long long ans = 0;
  for (i = 0; i < n - 1; i++) {
    for (j = i + 1; j < n; j++) {
      x1 = (x[i] + x[j]) / 2.0;
      y1 = (y[i] + y[j]) / 2.0;
      if (M.find(make_pair(x1, y1)) == M.end() || M[make_pair(x1, y1)] <= 1)
        continue;
      ans += (M[make_pair(x1, y1)]) * (M[make_pair(x1, y1)] - 1) / 2;
      M[make_pair(x1, y1)] = 0;
    }
  }
  printf("%lld\n", ans);
  return 0;
}

```