#include <bits/stdc++.h>
    using namespace std;
    map<pair<int, int>,bool> postojanje;
int CHECK(pair<int , int> A , pair<int , int> B, pair<int , int> C) 
{ 
    int brojac = 0; 
    int deltax = B.first- A.first ,deltay =  B.second -A.second ;

    if(postojanje[make_pair(C.first + deltax * 2 , C.second + deltay  * 2)])
        brojac++;
    if(deltax % 2 == 0 && deltay % 2 == 0 && postojanje[make_pair(C.first + deltax / 2 , C.second + deltay  / 2)])
        brojac++;
    deltax = C.first- A.first ,deltay =  C.second -A.second ;
        if(postojanje[make_pair(B.first + deltax * 2 , B.second + deltay  * 2)])
        brojac++;
    if(deltax % 2 == 0 && deltay % 2 == 0 && postojanje[make_pair(B.first + deltax / 2 , B.second + deltay  / 2)])
        brojac++;


        return brojac;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int N; cin >> N;
    vector<pair<int , int>> TACKE;
    int x , y ;
    for(int i = 0; i < N; i++)
    {   
        cin >> x >> y; 
        TACKE.push_back(make_pair(x,y));    
        postojanje[TACKE[i]] = true;
    }
    sort(TACKE.begin(),TACKE.end());
    long long brojac = 0;
    for(int i = 0; i < N -3 ; i++)
    { 
        for(int j = i + 1; j < N - 2; j++)
        {
            for(int k = j + 1; k < N - 1; k++)
            { 
                brojac+= CHECK(TACKE[i],TACKE[j],TACKE[k]);
            }   
        }
    }

    cout << brojac; 





    return 0;
}