#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};
    for(int j=i-1; j>=0; j--){
        ans+=f(pts[i], pts[j]);
    }
}
cout<<ans;

return 0;
}
