#include <bits/stdc++.h>
using namespace std;
struct tochka {
  int x, y;
};
tochka a[100003];
long long sum;
long long dp;
int main() {
  int i, j;
  int n;
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%d %d", &a[i].x, &a[i].y);
  if (n == 1) {
    printf("0\n");
    return 0;
  }
  long long ans = 0;
  long long sum1, sum2;
  sum1 = sum2 = 0;
  for (i = 0; i < n; i++) {
    ans += ((long long)i * (long long)a[i].x * a[i].x -
            2 * (long long)a[i].x * sum1 + sum2);
    sum1 += a[i].x;
    sum2 += (long long)a[i].x * a[i].x;
  }
  sum1 = sum2 = 0;
  for (i = 0; i < n; i++) {
    ans += ((long long)i * (long long)a[i].y * a[i].y -
            2 * (long long)a[i].y * sum1 + sum2);
    sum1 += a[i].y;
    sum2 += (long long)a[i].y * a[i].y;
  }
  printf("%I64d\n", ans);
  return 0;
}
