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

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

pair <int, int> pts[maxn];

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[i]={x, y};
}

sort(pts, pts+n);

int prev=0;

for(int i=0; i<n; i++){
    if(i>0 and pts[i].first==pts[i-1].first and pts[i].second==pts[i-1].second){
        ans+=prev;
        continue;
    }
    prev=0;
    for(int j=i+1; j<n; j++){
        prev+=f(pts[i], pts[j]);
    }
    ans+=prev;
}
cout<<ans<<endl;


return 0;
}
