#include <bits/stdc++.h>
using namespace std;
double x[(int)2e3 + 5], y[(int)2e3 + 5];
int fio() {
  int val = 0;
  char ch = getchar();
  while (ch == ' ' || ch == '\n') ch = getchar();
  while (ch >= '0' && ch <= '9') {
    val = val * 10 + ch - '0';
    ch = getchar();
  }
  return val;
}
int main() {
  int n, ans = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
  }
  map<pair<double, double>, int> mid_points;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      double mid_x = (x[i] + x[j]) / 2;
      double mid_y = (y[i] + y[j]) / 2;
      mid_points[make_pair(mid_x, mid_y)]++;
    }
  }
  map<pair<double, double>, int>::iterator it = mid_points.begin();
  while (it != mid_points.end()) {
    ans += it->second * (it->second - 1) / 2;
    it++;
  }
  cout << ans << endl;
  return 0;
}

### Prompt

Develop a solution in CPP 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>
using namespace std;
double x[(int)2e3 + 5], y[(int)2e3 + 5];
int fio() {
  int val = 0;
  char ch = getchar();
  while (ch == ' ' || ch == '\n') ch = getchar();
  while (ch >= '0' && ch <= '9') {
    val = val * 10 + ch - '0';
    ch = getchar();
  }
  return val;
}
int main() {
  int n, ans = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
  }
  map<pair<double, double>, int> mid_points;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      double mid_x = (x[i] + x[j]) / 2;
      double mid_y = (y[i] + y[j]) / 2;
      mid_points[make_pair(mid_x, mid_y)]++;
    }
  }
  map<pair<double, double>, int>::iterator it = mid_points.begin();
  while (it != mid_points.end()) {
    ans += it->second * (it->second - 1) / 2;
    it++;
  }
  cout << ans << endl;
  return 0;
}

```