#include <bits/stdc++.h>
long long x[100000], y[100000];
int main() {
  int n;
  scanf("%d", &n);
  long long sx2 = 0, sy2 = 0;
  for (int i = 0; i < n; i++) {
    scanf("%I64d %I64d", &x[i], &y[i]);
    sx2 += x[i] * x[i];
    sy2 += y[i] * y[i];
  }
  long long r = (n - 1) * (sx2 + sy2), sx = x[n - 1], sy = y[n - 1], a = 0,
            b = 0;
  for (int i = n - 2; i >= 0; i--) {
    a += x[i] * sx;
    b += y[i] * sy;
    sx += x[i];
    sy += y[i];
  }
  r -= 2 * (a + b);
  printf("%I64d\n", r);
  return 0;
}
