#include<iostream>
using namespace std;struct s{int x;int y;};
bool sus(s a,s b,s c,s d){
    long long r1=((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y)),r2=((c.x-d.x)*(c.x-d.x)+(c.y-d.y)*(c.y-d.y));
    if((a.x-b.x)*(c.y-d.y)==(a.y-b.y)*(c.x-d.x))return r1==4*r2||r2==4*r1;else return 0;}
int main(){int n,q=0;cin>>n;s C[n];for(s&o:C)cin>>o.x>>o.y;if(n<4){cout<<0;return 0;}
    for(int a=0;a<n;a++)for(int b=a+1;b<n;b++)for(int c=b+1;c<n;c++)for(int d=c+1;d<n;d++)
        if(sus(C[a],C[b],C[c],C[d]))q++;else{if(sus(C[a],C[c],C[b],C[d]))q++;else q+=sus(C[a],C[d],C[b],C[c]);}
    cout<<q<<endl;return 0;}