#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int x, y;
  long long res = 0, tmp;
  long long x2 = 0;
  long long y2 = 0;
  long long sumX = 0;
  long long sumY = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d %d", &x, &y);
    tmp = x * x;
    res += x2;
    res -= 2 * sumX * x;
    res += i * tmp;
    x2 += tmp;
    sumX += x;
    tmp = y * y;
    res += y2;
    res -= 2 * sumY * y;
    res += i * tmp;
    y2 += tmp;
    sumY += y;
  }
  printf("%I64d\n", res);
  return 0;
}
