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
#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long int lcm(long long int a, long long int b) {
  return a * b / gcd(a, b);
}
long long int fexp(long long int a, long long int b) {
  long long int ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % 1000000007;
    b /= 2;
    a = a * a % 1000000007;
  }
  return ans;
}
long long int inverse(long long int a, long long int p) {
  return fexp(a, p - 2);
}
void ingraph(vector<vector<long long int>>& graph, long long int m) {
  long long int x, y;
  for (long long int i = 0; i < m; i++) {
    cin >> x >> y;
    x--, y--;
    graph[x].push_back(y);
    graph[y].push_back(x);
  }
}
long long int dist(pair<long long int, long long int> a,
                   pair<long long int, long long int> b) {
  return (a.first - b.first) * (a.first - b.first) +
         (a.second - b.second) * (a.second - b.second);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int t;
  t = 1;
  while (t--) {
    long long int n;
    cin >> n;
    vector<pair<long long int, long long int>> points(n);
    for (long long int i = 0; i < n; i++)
      cin >> points[i].first >> points[i].second;
    map<pair<long double, long long int>, map<long double, long long int>> seg;
    for (long long int i = 0; i < n; i++) {
      for (long long int j = i + 1; j < n; j++) {
        long long int dx = points[i].first - points[j].first;
        long long int dy = points[i].second - points[j].second;
        long long int d = dist(points[i], points[j]);
        if (dx == 0) {
          seg[make_pair((long long int)1e18, d)][points[i].first]++;
        } else {
          long double slope = 1.0 * dy / dx;
          long double intercept = points[i].second - slope * points[i].first;
          seg[make_pair(slope, d)][intercept]++;
        }
      }
    }
    long long int ans = 0;
    map<pair<long double, long long int>,
        map<long double, long long int>>::iterator itr = seg.begin();
    while (itr != seg.end()) {
      long long int sum = 0;
      map<long double, long long int>::iterator fin = itr->second.begin();
      while (fin != itr->second.end()) {
        ans += sum * fin->second;
        sum += fin->second;
        fin++;
      }
      itr++;
    }
    cout << ans / 2;
  }
}
