#include <bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

const int MAX_N = 1e6;
const int INF = 1e9;

std::pair<int, int> p[MAX_N];

int main (){

    std::ios_base::sync_with_stdio(false);
    std::cin.tie(NULL);

    int n;
    std::cin>>n;
    for( int i=0 ; i<n ; i++ ) std::cin>>p[i].first>>p[i].second;

    ll ans = 0;
    for( int i=0 ; i<n ; i++ ){
        for( int j = i+1 ; j<n ; j++ ){
            ans += ( p[i].first - p[j].first ) * ( p[i].first - p[j].first );
            ans += ( p[i].second - p[j].second ) * ( p[i].second - p[j].second );
        }
    }

    std::cout<<ans<<"\n";

    return 0;
}
