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;
const double pi = acos(-1);
int cmp(double a, double b = 0) {
  if (fabs(a - b) < 1e-8) return 0;
  if (a < b) return -1;
  return 1;
}
struct pt {
  double x, y;
  explicit pt(double x = 0, double y = 0) : x(x), y(y) {}
  pt operator+(pt q) { return pt(x + q.x, y + q.y); }
  pt operator-(pt q) { return pt(x - q.x, y - q.y); }
  pt operator*(double t) { return pt(x * t, y * t); }
  pt operator/(double t) { return pt(x / t, y / t); }
  double operator*(pt q) { return x * q.x + y * q.y; }
  double operator%(pt q) { return x * q.y - y * q.x; }
  int cmp(pt q) const {
    if (int t = ::cmp(x, q.x)) return t;
    return ::cmp(y, q.y);
  }
  bool operator==(pt q) const { return cmp(q) == 0; }
  bool operator!=(pt q) const { return cmp(q) != 0; }
  bool operator<(pt q) const { return cmp(q) < 0; }
};
ostream& operator<<(ostream& os, const pt& p) {
  os << "(" << p.x << ", " << p.y << ")";
  return os;
}
struct reta {
  pt ini, fim;
  reta() {}
  reta(pt ini, pt fim) : ini(ini), fim(fim) {}
};
struct eq_reta {
  double A, B, C;
  void init(reta p) {
    pt aux = p.ini - p.fim;
    A = aux.y;
    B = -aux.x;
    C = -A * p.ini.x - B * p.ini.y;
  }
  eq_reta(reta p) { init(p); }
};
pt normal(pt v) { return pt(-v.y, v.x); }
double norma(pt v) { return hypot(v.x, v.y); }
pt versor(pt v) { return v / norma(v); }
double anglex(pt v) { return atan2(v.y, v.x); }
double angle(pt v1, pt v2) { return atan2(v1 % v2, v1 * v2); }
double triarea(pt a, pt b, pt c) { return ((b - a) % (c - a)) / 2.0; }
int ccw(pt a, pt b, pt c) { return cmp((b - a) % (c - a)); }
pt projecao(pt v, pt w) {
  double alfa = (v * w) / (w * w);
  return w * alfa;
}
pt pivo;
bool cmp_radial(pt a, pt b) {
  int aux = ccw(pivo, a, b);
  return ((aux < 0) || (aux == 0 && norma(a - pivo) < norma(b - pivo)));
}
bool cmp_pivo(pt p, pt q) {
  int aux = cmp(p.x, q.x);
  return ((aux < 0) || (aux == 0 && cmp(p.y, q.y) < 0));
}
vector<pt> graham(vector<pt> p) {
  int i, j, n = p.size();
  vector<pt> g;
  pivo = *min_element(p.begin(), p.end(), cmp_pivo);
  sort(p.begin(), p.end(), cmp_radial);
  for (i = n - 2; i >= 0 && ccw(p[0], p[i], p[n - 1]) == 0; i--)
    ;
  reverse(p.begin() + i + 1, p.end());
  for (i = j = 0; i < n; i++) {
    while (j >= 2 && ccw(g[j - 2], g[j - 1], p[i]) >= 0) {
      g.pop_back();
      j--;
    }
    g.push_back(p[i]);
    j++;
  }
  return g;
}
int between3(pt p, pt q, pt r) {
  if (cmp((q - p) % (r - p)) == 0)
    if (cmp((q - p) * (r - p)) <= 0) return 1;
  return 0;
}
double distPR(pt p, reta r) {
  pt v = p - r.ini;
  pt w = r.fim - r.ini;
  pt proj = projecao(v, w);
  if (!between3(proj + r.ini, r.ini, r.fim))
    return min(norma(p - r.ini), norma(p - r.fim));
  return norma(v - proj);
}
bool iscolin(pt p, pt q, pt r) {
  if (cmp((q - p) % (r - p)) == 0) return true;
  return false;
}
int my_gcd(int a, int b) {
  if (b == 0) return a;
  return my_gcd(b, a % b);
}
const int MAXN = 2010;
pair<int, int> v[MAXN];
int main() {
  ios::sync_with_stdio(false);
  ;
  map<pair<pair<int, int>, long long>, int> mp;
  int n;
  cin >> n;
  for (int i = 0; i < (n); ++i) {
    cin >> v[i].first >> v[i].second;
    for (int j = 0; j < (i); ++j) {
      pair<int, int> p =
          make_pair(v[i].first - v[j].first, v[i].second - v[j].second);
      int g = my_gcd(p.first, p.second);
      p.first /= g;
      p.second /= g;
      if (p.first < 0 && p.second < 0) {
        p.first *= -1;
        p.second *= -1;
      } else if (p.first < 0 || p.second < 0) {
        p.first = -abs(p.first);
        p.second = abs(p.second);
      }
      long long dx = v[i].first - v[j].first;
      long long dy = v[i].second - v[j].second;
      long long len = dx * dx + dy * dy;
      ++mp[make_pair(p, len)];
    }
  }
  long long ans = 0;
  for (__typeof((mp).begin()) it = (mp).begin(); it != (mp).end(); ++it) {
    long long aux = it->second;
    ans += (aux) * (aux - 1) / 2;
  }
  cout << ans / 2 << endl;
  return 0;
}
