#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000 + 10;
struct Point {
  long long x, y;
} p[maxn];
int n;
long long sum[maxn];
long long a[maxn];
long long get(int x) {
  long long res = 0;
  int tot = 0;
  if (x == 0)
    for (int i = 1; i <= n; i++) a[i] = p[i].x;
  else
    for (int i = 1; i <= n; i++) a[i] = p[i].y;
  sum[n + 1] = 0;
  for (int i = n; i >= 1; i--) sum[i] = sum[i + 1] + a[i];
  for (int i = 1; i <= n; i++) res = res + a[i] * a[i] * (n - 1);
  for (int i = 1; i <= n - 1; i++) res = res - 2 * a[i] * sum[i + 1];
  return res;
}
int main() {
  scanf("%d", &n);
  long long ans = 0;
  for (int i = 1; i <= n; i++) scanf("%lld%lld", &p[i].x, &p[i].y);
  ans = ans + get(0);
  ans = ans + get(1);
  printf("%lld\n", ans);
  return 0;
}
