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