#include <iostream>
#include<stdio.h>
#include <cmath>



using namespace std;
struct point
{
public:
    float x;
    float y;

};

int xt = 0;

bool jesuPararelne(point a1, point b1,
                   point a2, point b2)
{
    float Slope1, Slope2;
    if(a1.x == b1.x)
        Slope1 = INT_MAX;
    else
        Slope1 = (a1.y - b1.y) / (a1.x - b1.x);
    if(a2.x == b2.x)
        Slope2 = INT_MAX;
    else
        Slope2 = (a2.y - b2.y) / (a2.x - b2.x);
    return (Slope1 == Slope2);
}

float razdaljina(point a, point b)
{
    float x = sqrt(pow(a.x - b.x, 2) + pow(a.y - b.y, 2));
    return x;
}

int main(){
    int n;
    cin >> n;
    struct point tacke[n];
    for(int i=0;i<n;i++)
    {
        point l;
        cin >> l.x >> l.y;
        tacke[i] = l;
    }

    //-----------------------------------

    float matrix[n][n];
    for(int i=0;i<n;i++)
    {
        for(int j=i+1;j<n;j++)
        {
            matrix[i][j] = razdaljina(tacke[i], tacke[j]);
        }
    }
    for(int i=0;i<n-3;i++)
    {
        for(int j=i+1;j<n;j++)
        {
            for(int k=i+1;k<n;k++)
            {
                if(k == j)
                    continue;
                for(int l=k+1;l<n;l++)
                {
                    if(l == j)
                        continue;
                    if(matrix[i][j] == 2 * matrix[k][l] || matrix[i][j]*2 == matrix[k][l])
                    {
                        if(jesuPararelne(tacke[k], tacke[l], tacke[i], tacke[j]))
                            xt++;

                    }

                }
            }
        }
    }
    cout << xt;

   return 0;
}