#include <bits/stdc++.h>
int x[100010];
int y[100010];
int main() {
  int i;
  int n;
  long long Sqsum = 0, sumX = 0, sumY = 0;
  scanf("%d", &n);
  if (n == 1) {
    printf("0\n");
    return 0;
  }
  for (i = 0; i < n; i++) {
    scanf("%d%d", &x[i], &y[i]);
    Sqsum += x[i] * x[i] + y[i] * y[i];
    sumX += x[i];
    sumY += y[i];
  }
  long long ans = n * Sqsum - sumX * sumX - sumY * sumY;
  printf("%I64d\n", ans);
  return 0;
}
