#include <bits/stdc++.h>
using namespace std;
long long x, y, sx, sy;
int N;
int main() {
  scanf("%d\n", &N);
  for (int i = 0; i < N; i++) {
    int a, b;
    scanf("%d %d\n", &a, &b);
    x += a, y += b, sx += a * a, sy += b * b;
  }
  printf("%I64d\n", (sx * N - x * x) + (sy * N - y * y));
  return 0;
}
