#include<iostream>
#define endl '\n'
using namespace std;
long long n,x[100005],y[100005],t1,t2,rez;
long long ab(long long a)
{
    if(a<0) return -a;
    return a;
}
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    cin>>n;

    for(int i=0;i<n;i++)
    {
        cin>>x[i]>>y[i];
        for(int j=i-1;j>=0;j--)
        {
              t1=ab(x[i]-x[j]);
              t1*=t1;
              t2=ab(y[i]-y[j]);
              t2*=t2;
              rez+=(t1+t2);
        }
    }
    cout<<rez<<endl;
}

