#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:67108864")
using namespace std;
int n;
long long x[100100], y[100100], sum_x = 0, sum_y = 0;
long long res_x = 0, res_y = 0;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++)
    scanf("%I64d%I64d", &x[i], &y[i]), sum_x += x[i], sum_y += y[i];
  for (int i = 0; i < n; i++) {
    res_x += x[i] * x[i] * (n - 1);
    res_x -= x[i] * (sum_x - x[i]);
    res_y += y[i] * y[i] * (n - 1);
    res_y -= y[i] * (sum_y - y[i]);
  }
  printf("%I64d", (res_x + res_y));
  return 0;
}
