#include<iostream>
using namespace std;
int main(){
    long long N,sum=0;
    pair<long long,long long> a[1000000];
    cin>>N;
    for(long long i=0;i<N;i++){
        cin>>a[i].first>>a[i].second;
    }
    for(long long i=0;i<N;i++){
        for(long long j=j;j<N;j++){
            sum+=(a[i].first-a[i].first)*(a[i].first-a[i].first)+(a[i].second-a[i].second)*(a[i].second-a[i].second);
        }
    }
    cout<<sum;
return 0;
}
