#include<iostream>
using namespace std;
const int maxn=100009;
long long n,ans;
pair<int,int> a[maxn];
int main(){
    cin>>n;
    for(int i=0;i<n;i++) cin>>a[i].first>>a[i].second;
    for(int i=0;i<n;i++){
        for(int j=i+1;j<n;j++){
            auto p1=a[i],p2=a[j];
            int x1=p1.first,y1=p1.second,x2=p2.first,y2=p2.second;
            int a=abs(x1-x2),b=abs(y1-y2);
            ans+=a*a+b*b;
        }
    }
    cout<<ans<<"\n";
    return 0;
}
