#include <bits/stdc++.h>
typedef struct point {
  int x, y;
} point;
int main() {
  int n, i;
  long long res[2], res2[2], result;
  point p;
  while (scanf("%d", &n) != EOF) {
    res[0] = 0, res[1] = 0, res2[0] = 0, res2[1] = 0;
    for (i = 0; i < n; i++) {
      scanf("%d%d", &p.x, &p.y);
      res[0] += p.x, res[1] += p.y;
      res2[0] += p.x * p.x, res2[1] += p.y * p.y;
    }
    result = n * (res2[0] + res2[1]) - res[0] * res[0] - res[1] * res[1];
    printf("%I64d\n", result);
  }
  return 0;
}
