#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
int n;
long long ans = 0, x1, x2, y3, y2;
vector<long long> x(100001), y(100001);
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> x[i] >> y[i];
  for (int i = 0; i < n; ++i) {
    x1 += x[i];
    x2 += (long long)x[i] * x[i];
    y3 += y[i];
    y2 += (long long)y[i] * y[i];
  }
  ans = n * x2 - x1 * x1 + n * y2 - y3 * y3;
  cout << ans;
  return 0;
}
