#include <bits/stdc++.h>
using namespace std;
long long x = 0, y = 0, m = 0, n = 0, ans = 0, a, b;
int k;
void input() {
  cin >> k;
  return;
}
void output() {
  cout << ans;
  return;
}
void lolicon() {
  for (int i = 0; i < k; i++) {
    cin >> a >> b;
    ans += x;
    ans -= 2 * m * a;
    ans += i * a * a;
    x += a * a;
    m += a;
    ans += y;
    ans -= 2 * n * b;
    ans += i * b * b;
    y += b * b;
    n += b;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  input();
  lolicon();
  output();
  return 0;
}
