#include <iostream>
#include <math.h>
using namespace std;
long x[100000],y[100000];
double d[100000000];
int main()
{
    long n,br=0,pr=0;
    double counter1,counter2;
    cin>>n;
    for(int g=0;g<n;g++)
    {
        cin>>x[g]>>y[g];
    }
    for(int g=0;g<n-1;g++)
    {
        for(int j=g+1;j<n;j++)
        {
            counter1=0;
            counter2=0;
            if(x[g]==x[j])
            {
                d[pr]=y[g]-y[j];
                if(d[pr]<0) d[pr]*=-1;
            }
            else if(y[g]==y[j])
            {
                d[pr]=x[g]-x[j];
                if(d[pr]<0) d[pr]*=-1;
            }
            else
            {
                counter1=x[g]-x[j];
                if(counter1<0) counter1*=-1;
                counter1*=counter1;
                counter2=y[g]-y[j];
                counter2*=counter2;
                if(counter2<0) counter2*=-1;
                d[pr]=sqrt(counter1+counter2);
            }
            pr++;
        }
    }
    for(int g=0;g<pr;g++)
    {
        br+=pow(d[g],2);
    }
    cout<<br;
    return 0;
}
