#include <bits/stdc++.h>
using namespace std;
long long ans = 0, x = 0, y = 0, n;
signed main() {
  cin >> n;
  for (long long i = 0; i < n; ++i) {
    long long in1, in2;
    cin >> in1 >> in2;
    ans += (n - 1) * (in1 * in1 + in2 * in2) - in1 * x * 2 - in2 * y * 2;
    x += in1, y += in2;
  }
  cout << ans;
  return 0;
}
