#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9;
const long long N = 3e5 + 2;
const long long mod = 1e9 + 7;
const long double eps = 1E-7;
long long n, ans;
pair<long double, long double> c;
long double a, b, x[N], y[N];
map<pair<long double, long double>, long long> mp;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> x[i] >> y[i];
    for (int j = 1; j < i; j++) {
      a = (x[j] + x[i]) / 2;
      b = (y[j] + y[i]) / 2;
      c = {a, b}, ans += mp[c], mp[c]++;
    }
  }
  cout << ans << endl;
}

### Prompt

Construct a cpp code solution to the problem outlined:

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 long long INF = 1e9;
const long long N = 3e5 + 2;
const long long mod = 1e9 + 7;
const long double eps = 1E-7;
long long n, ans;
pair<long double, long double> c;
long double a, b, x[N], y[N];
map<pair<long double, long double>, long long> mp;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> x[i] >> y[i];
    for (int j = 1; j < i; j++) {
      a = (x[j] + x[i]) / 2;
      b = (y[j] + y[i]) / 2;
      c = {a, b}, ans += mp[c], mp[c]++;
    }
  }
  cout << ans << endl;
}

```