#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
template <typename T>
inline void write(T x) {
  long long i = 20;
  char buf[21];
  buf[20] = '\n';
  do {
    buf[--i] = x % 10 + '0';
    x /= 10;
  } while (x);
  do {
    putchar(buf[i]);
  } while (buf[i++] != '\n');
}
void read(long long &x) {
  bool neg = false;
  register long long c;
  x = 0;
  c = getchar();
  if (c == '-') {
    neg = true;
    c = getchar();
  }
  for (; (c > 47 && c < 58); c = getchar()) x = (x << 1) + (x << 3) + c - 48;
  if (neg) x *= -1;
}
long long i, n, x[100005], y[100005], x_sum = 0, y_sum = 0;
;
int main() {
  cin >> n;
  for (i = 0; i <= n - 1; i++) {
    cin >> x[i] >> y[i];
  }
  long long ans = 0;
  for (i = 0; i <= n - 1; i++)
    ans += (n - 1) * x[i] * x[i] + (n - 1) * y[i] * y[i];
  for (i = 0; i <= n - 2; i++) {
    x_sum += x[i];
    ans -= 2 * x_sum * x[i + 1];
    y_sum += y[i];
    ans -= 2 * y_sum * y[i + 1];
  }
  cout << ans << endl;
  return 0;
}
