#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<pair<int, int> > v;
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    v.push_back(make_pair(y, x));
  }
  sort(v.begin(), v.end());
  int res = 0;
  for (int i = 0; i < n; i++) {
    int j = i + 1, k = i + 2;
    while (k < n) {
      int x = 2 * v[j].second - v[i].second;
      int y = 2 * v[j].first - v[i].first;
      pair<int, int> c = make_pair(y, x);
      if (c > v[k])
        k++;
      else if (c < v[k])
        j++;
      else
        res++, j++, k++;
    }
  }
  cout << res;
}
