//枚举顶点。
//不存在等边三角形
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int n=2e3+11;
int a,b,c,l[n],r[n];
signed main()
{ios::sync_with_stdio(false);cin.tie(0),cout.tie(0);cin>>a;for(int i=1;i<=a;i++){cin>>l[i]>>r[i];}int an=0,l1,r1;for(int i=1;i<=a;i++){unordered_map<int,int>t;map<pair<int,int>,int>l2;for(int j=1;j<=a;j++){int v=(l[i]-l[j])*(l[i]-l[j])+(r[i]-r[j])*(r[i]-r[j]);if(t[v]>=1){if(l[j]>=l[i]){l1=l[i]-(l[j]-l[i]);}else{l1=l[i]+(l[i]-l[j]);}if(r[j]>=r[i]){r1=r[i]-(r[j]-r[i]);}else{r1=r[i]+r[i]-r[j];}if(l2[{l1,r1}]==1){an+=t[v]-1;}else{an+=t[v];}}t[v]++;l2[{l[j],r[j]}]=1;}}cout<<an<<endl;
}