#include <bits/stdc++.h>
int n;
int main() {
  int i;
  long long ans, sumx, sumy, x, y;
  scanf("%d", &n);
  ans = sumx = sumy = 0;
  for (i = 0; i < n; i++) {
    scanf("%I64d%I64d", &x, &y);
    ans += (long long)x * x * n + y * y * n;
    sumx += x;
    sumy += y;
  }
  printf("%I64d", ans - sumx * sumx - sumy * sumy);
}
