#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int MAXN = 3000 + 10;
int N, X[MAXN], Y[MAXN];
bool F[2012][2012];
int main(int argc, char *argv[]) {
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    scanf("%d%d", &X[i], &Y[i]);
    X[i] += 1000;
    Y[i] += 1000;
    F[X[i]][Y[i]] = true;
  }
  int Ret = 0;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++)
      if (i != j) {
        int x = X[j] * 2 - X[i];
        int y = Y[j] * 2 - Y[i];
        if (x >= 0 && x <= 2000 && y >= 0 && y <= 2000) {
          Ret += F[x][y];
        }
      }
  }
  printf("%d\n", Ret >> 1);
  return 0;
}
