#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long x1 = 0, x2 = 0, y1 = 0, y2 = 0;
  long long x, y;
  int q = n;
  while (q--) {
    scanf("%lld %lld", &x, &y);
    x1 += x;
    y1 += y;
    x2 += x * x;
    y2 += y * y;
  }
  long long xr = -x1 * x1 + n * x2;
  long long yr = -y1 * y1 + n * y2;
  long long res = (xr + yr);
  cout << res;
}
