#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
long long n, x[N], y[N], cur1, cur2, ans;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> x[i] >> y[i];
  }
  cur1 = x[1];
  cur2 = x[1] * x[1];
  for (int i = 2; i <= n; i++) {
    ans += (i - 1) * x[i] * x[i] - 2 * x[i] * cur1 + cur2;
    cur1 += x[i];
    cur2 += x[i] * x[i];
  }
  cur1 = y[1];
  cur2 = y[1] * y[1];
  for (int i = 2; i <= n; i++) {
    ans += (i - 1) * y[i] * y[i] - 2 * y[i] * cur1 + cur2;
    cur1 += y[i];
    cur2 += y[i] * y[i];
  }
  cout << ans;
}
