#include <bits/stdc++.h>
int diru[] = {-1, -1, -1, 0, 0, 1, 1, 1};
int dirv[] = {-1, 0, 1, -1, 1, -1, 0, 1};
using namespace std;
struct debugger {
  template <typename T>
  debugger& operator,(const T& v) {
    cerr << v << " ";
    return *this;
  }
} dbg;
template <class T>
T sq(T n) {
  return n * n;
}
template <class T>
T gcd(T a, T b) {
  return (b != 0 ? gcd<T>(b, a % b) : a);
}
template <class T>
T lcm(T a, T b) {
  return (a / gcd<T>(a, b) * b);
}
template <class T>
bool inside(T a, T b, T c) {
  return a <= b && b <= c;
}
template <class T>
void setmax(T& a, T b) {
  if (a < b) a = b;
}
template <class T>
void setmin(T& a, T b) {
  if (b < a) a = b;
}
template <class T>
T power(T N, T P) {
  return (P == 0) ? 1 : N * power(N, P - 1);
}
long long int x[100010];
long long int y[100010];
int main() {
  int T, t = 1, m, i, j, k;
  long long int n;
  scanf("%lld", &n);
  for (i = 0; i < n; i++) {
    scanf("%lld", &x[i]);
    scanf("%lld", &y[i]);
  }
  long long int s2 = 0;
  long long int sx = 0;
  long long int sy = 0;
  for (i = 0; i < n; i++) {
    s2 += (((x[0] - x[i]) * (x[0] - x[i])) + ((y[0] - y[i]) * (y[0] - y[i])));
    sx += x[0] - x[i];
    sy += y[0] - y[i];
  }
  long long int ans = s2;
  for (i = 1; i < n; i++) {
    long long int a = x[i] - x[i - 1];
    long long int b = y[i] - y[i - 1];
    s2 += a * a * n + b * b * n + 2LL * a * sx + 2LL * b * sy;
    sx += a * n;
    sy += b * n;
    ans += s2;
  }
  ans /= 2LL;
  cout << ans << endl;
  return 0;
}
