#include <bits/stdc++.h>
using namespace std;
inline void pisz(int n) { printf("%d\n", n); }
template <typename T, typename TT>
ostream& operator<<(ostream& s, pair<T, TT> t) {
  return s << "(" << t.first << "," << t.second << ")";
}
template <typename T>
ostream& operator<<(ostream& s, vector<T> t) {
  for (int(i) = 0; (i) < (t.size()); ++(i)) s << t[i] << " ";
  return s;
}
int main() {
  int(n);
  scanf("%d", &(n));
  long long skwx = 0, sx = 0, skwy = 0, sy = 0;
  for (int(i) = 0; (i) < (n); ++(i)) {
    int(x), (y);
    scanf("%d %d", &(x), &(y));
    skwx += (long long)x * x;
    skwy += (long long)y * y;
    sx += x;
    sy += y;
  }
  cout << n * (skwx + skwy) - (sx * sx + sy * sy) << endl;
}
