#include<bits/stdc++.h>
using namespace std;

const int maxn=100003;
int n;
unsigned long long ans=0;

set <pair <int, int>> pts;

int f(pair<int, int> a, pair<int, int> b){
    if(a.first==b.first){
        return (a.second-b.second)*(a.second-b.second);
    }
    if(a.second==b.second){
        return (a.first-b.first)*(a.first-b.first);
    }
    int d_x=a.first-b.first, d_y=a.second-b.second;
    return (d_x*d_x)+(d_y*d_y);
}

int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);

cin>>n;
for(int i=0; i<n; i++){
    int x, y;
    cin>>x>>y;
    x+=10000;
    y+=10000;
    pts.insert({x, y});
}

for(auto it=pts.begin(); it!=pts.end(); it++){
    for(auto it_1=it; it_1!=pts.end(); it_1++){
        if(it_1==it){
            continue;
        }
        ans+=f(*it, *it_1);
    }
}
cout<<ans<<endl;


return 0;
}
