#include<iostream>
using namespace std;
int n,a[100000],b[100000];
long long v1;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>a[i]>>b[i];
    }
    v1=0;
    for(int i=0;i<n-1;i++){
        for(int i1=i+1;i1<n;i1++){
            //int ng=max(a[i],a[i1]),nm=min(a[i],a[i1]);
            //int ng1=max(b[i],b[i1]),nm1=min(b[i],b[i1]);
            long long l;
            l=(a[i]-a[i1])*(a[i]-a[i1])+(b[i]-b[i1])*(b[i]-b[i1]);
            v1+=l;
        }
    }
    cout<<v1<<"\n";
    return 0;
}

