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

double n, p[10002][2], ans, sum_x, sum_y, sqx, sqy;

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

cin >> n;

for (int i=0; i < n; i++) {
    cin >> p[i][0] >> p[i][1];
    sqx += p[i][0]*p[i][0];
    sqy += p[i][1]*p[i][1];
    sum_x += p[i][0];
    sum_y += p[i][1];
}

ans = ans + (n*sqx - sum_x*sum_x);
ans = ans + (n*sqy - sum_y*sum_y);

cout << ans << endl;

return 0;
}