#include <bits/stdc++.h>
using namespace std;
template <class T1, class T2>
ostream& operator<<(ostream& os, const pair<T1, T2>& p) {
  os << "{" << p.first << ", " << p.second << "}";
  return os;
}
template <class T>
ostream& operator<<(ostream& os, const vector<T>& p) {
  os << "[";
  int i = 0;
  for (typename vector<T>::const_iterator it = p.begin(); it != p.end(); ++it) {
    os << (i == 0 ? "" : ", ") << *it;
    i++;
  }
  os << "]";
  return os;
}
template <class T>
ostream& operator<<(ostream& os, const set<T>& p) {
  os << "[";
  int i = 0;
  for (typename set<T>::const_iterator it = p.begin(); it != p.end(); ++it) {
    os << (i == 0 ? "" : ", ") << *it;
    i++;
  }
  os << "]";
  return os;
}
template <class K, class V>
ostream& operator<<(ostream& os, const map<K, V>& p) {
  os << "[";
  int i = 0;
  for (typename map<K, V>::const_iterator it = p.begin(); it != p.end(); ++it) {
    os << (i == 0 ? "" : ", ") << *it;
    i++;
  }
  os << "]";
  return os;
}
template <class T>
string toString(const T& o) {
  stringstream ss;
  ss << o;
  string ret;
  getline(ss, ret);
  return ret;
}
template <class T>
vector<T> subv(const vector<T>& v, int from, int to) {
  return vector<T>(v.begin() + min(max(0, from), (int)v.size()),
                   v.begin() + min(max(0, to), (int)v.size()));
}
int main() {
  int n;
  cin >> n;
  long long sqx = 0, sqy = 0, smx = 0, smy = 0;
  for (int i = 0; i < n; ++i) {
    long long x, y;
    cin >> x >> y;
    smx += x;
    smy += y;
    sqx += x * x;
    sqy += y * y;
  }
  cout << n * sqx - (smx * smx) + n * sqy - (smy * smy) << endl;
  return 0;
}
