#include <bits/stdc++.h>
using namespace std;
using ull = unsigned long long;
using ll = long long;
using ld = long double;
using vi = vector<ll>;
using vvi = vector<vi>;
using vb = vector<bool>;
using ii = pair<ll, ll>;
constexpr bool LOG = true;
void Log() {
  if (LOG) cerr << "\n";
}
template <class T, class... S>
void Log(T t, S... s) {
  if (LOG) cerr << t << "\t", Log(s...);
}
struct P {
  ll x, y;
};
struct D {
  ll dx, dy;
  ll d;
};
bool operator<(D l, D r) { return tie(l.dx, l.dy, l.d) < tie(r.dx, r.dy, r.d); }
ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b); }
D get(P l, P r) {
  ll dx = l.x - r.x;
  ll dy = l.y - r.y;
  ll d = dx * dx + dy * dy;
  ll g = gcd(dx, dy);
  dx /= g;
  dy /= g;
  if (dx < 0) dx = -dx, dy = -dy;
  return {dx, dy, d};
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  ll n;
  cin >> n;
  vector<P> ps(n);
  for (auto &p : ps) cin >> p.x >> p.y;
  map<D, ll> m;
  for (auto i = decltype(n)(0); i < (n); ++i)
    for (auto j = decltype(i)(0); j < (i); ++j) ++m[get(ps[i], ps[j])];
  ll ans = 0;
  for (auto x : m) ans += x.second * (x.second - 1) / 2;
  cout << ans / 2 << 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;
using ull = unsigned long long;
using ll = long long;
using ld = long double;
using vi = vector<ll>;
using vvi = vector<vi>;
using vb = vector<bool>;
using ii = pair<ll, ll>;
constexpr bool LOG = true;
void Log() {
  if (LOG) cerr << "\n";
}
template <class T, class... S>
void Log(T t, S... s) {
  if (LOG) cerr << t << "\t", Log(s...);
}
struct P {
  ll x, y;
};
struct D {
  ll dx, dy;
  ll d;
};
bool operator<(D l, D r) { return tie(l.dx, l.dy, l.d) < tie(r.dx, r.dy, r.d); }
ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b); }
D get(P l, P r) {
  ll dx = l.x - r.x;
  ll dy = l.y - r.y;
  ll d = dx * dx + dy * dy;
  ll g = gcd(dx, dy);
  dx /= g;
  dy /= g;
  if (dx < 0) dx = -dx, dy = -dy;
  return {dx, dy, d};
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  ll n;
  cin >> n;
  vector<P> ps(n);
  for (auto &p : ps) cin >> p.x >> p.y;
  map<D, ll> m;
  for (auto i = decltype(n)(0); i < (n); ++i)
    for (auto j = decltype(i)(0); j < (i); ++j) ++m[get(ps[i], ps[j])];
  ll ans = 0;
  for (auto x : m) ans += x.second * (x.second - 1) / 2;
  cout << ans / 2 << endl;
  return 0;
}

```