#include <bits/stdc++.h>
using namespace std;
const int N = 2e3 + 5;
const int mod = 1e9 + 7;
const int inf = 1e9 + 9;
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
map<pair<int, int>, int> mp;
int n;
pair<int, int> a[N];
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i].first >> a[i].second;
  }
  sort(a, a + n);
  for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j < n; ++j) {
      pair<int, int> dif = {a[i].first - a[j].first, a[i].second - a[j].second};
      mp[dif]++;
    }
  }
  long long ans = 0;
  for (auto it : mp) {
    long long cur = it.second;
    ans += (cur * (cur - 1)) / 2;
  }
  cout << ans / 2 << endl;
  return 0;
}

### Prompt

Please formulate a CPP solution to the following problem:

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>
using namespace std;
const int N = 2e3 + 5;
const int mod = 1e9 + 7;
const int inf = 1e9 + 9;
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
map<pair<int, int>, int> mp;
int n;
pair<int, int> a[N];
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i].first >> a[i].second;
  }
  sort(a, a + n);
  for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j < n; ++j) {
      pair<int, int> dif = {a[i].first - a[j].first, a[i].second - a[j].second};
      mp[dif]++;
    }
  }
  long long ans = 0;
  for (auto it : mp) {
    long long cur = it.second;
    ans += (cur * (cur - 1)) / 2;
  }
  cout << ans / 2 << endl;
  return 0;
}

```