#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  map<pair<int, int>, int> mapi;
  vector<pair<int, int>> arr(n);
  long long a, b;
  for (int i = 0; i < n; i++) {
    cin >> a >> b;
    arr[i].first = a;
    arr[i].second = b;
    mapi.insert({{a, b}, 1});
  }
  sort(arr.begin(), arr.end());
  long long res = 0;
  long long difa, difb;
  map<pair<int, int>, int>::iterator it;
  for (int i = 0; i < n; i++) {
    for (int ii = i + 1; ii < n; ii++) {
      difa = arr[ii].first - arr[i].first;
      difb = arr[ii].second - arr[i].second;
      difa = arr[ii].first + difa;
      difb = arr[ii].second + difb;
      it = mapi.find({difa, difb});
      if (it != mapi.end()) res++;
    }
  }
  cout << res << endl;
  return 0;
}
