#include <bits/stdc++.h>
using namespace std;
long n, x, y, i;
long long ans, xsum, ysum;
int main() {
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> x >> y;
    ans += x * x;
    ans += y * y;
    xsum += x;
    ysum += y;
  }
  xsum = xsum * xsum;
  ysum = ysum * ysum;
  ans = n * ans - xsum - ysum;
  cout << ans << endl;
}
