#include <iostream>
#include <cmath>
using namespace std;
int jeltrapez(int x1,int y1,int x2,int y2,int x3, int y3, int x4, int y4){
    int vrati=0,e=2;
    int dx1=abs(x1-x2);
    int dy1=abs(y1-y2);
    int dx2=abs(x3-x4);
    int dy2=abs(y3-y4);
    if(dx1==0||dy1==0||dx2==0||dy2==0){
        e=0;
    }
    if((dx1==2*dx2 && dy1==2*dy2) || (dx2==2*dx1 && dy2==2*dy1)){
        vrati = 1;
    }
    dx1=abs(x1-x3);
    dy1=abs(y1-y3);
    dx2=abs(x2-x4);
    dy2=abs(y2-y4);
    if((dx1==2*dx2 && dy1==2*dy2) || (dx2==2*dx1 && dy2==2*dy1)){
        vrati = 1;
    }
    vrati=min(vrati,e);
    return vrati;
}
int main()
{
    int x,y,n;
    cin >> n;
    int px[n],py[n];
    int bt=0;
    for(int i =0;i<n;i++){
        cin>>x>>y;
        px[i]=x;
        py[i]=y;
    }
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            for(int o=0;o<n;o++){
                for(int l=0;l<n;l++){
                    bt+=jeltrapez(px[i],py[i],px[j],py[j],px[o],py[o],px[l],py[l]);
                }
            }
        }
    }
    cout<<bt/12;
    return 0;
}