#include <bits/stdc++.h>
using namespace std;
int main() {
  set<int> s[10001];
  int n;
  cin >> n;
  int x[n], y[n];
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
    if (x[i] < 0)
      s[x[i] + 3000].insert(y[i]);
    else
      s[x[i]].insert(y[i]);
  }
  long long ans = 0;
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++) {
      if (abs(x[i] - x[j]) % 2 == 0 && abs(y[i] - y[j]) % 2 == 0) {
        int t = abs(x[i] - x[j]) / 2 + min(x[i], x[j]);
        int z = abs(y[i] - y[j]) / 2 + min(y[i], y[j]);
        if (t < 0) {
          if (s[t + 3000].find(z) != s[t + 3000].end()) ans++;
        } else {
          if (s[t].find(z) != s[t].end()) ans++;
        }
      }
    }
  cout << ans;
}
