#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  scanf("%d", &n);
  long long sx = 0, sy = 0, s2x = 0, s2y = 0;
  for (int i = 0; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    sx += x;
    sy += y;
    s2x += x * x;
    s2y += y * y;
  }
  cout << (s2x + s2y) * (n - 1) - (sx * sx + sy * sy - s2x - s2y) << endl;
  return 0;
}
