#include <bits/stdc++.h>
using namespace std;
const int MAX_STRING_LENGTH = 1000;
char buff[MAX_STRING_LENGTH];
struct _in {
  int _eof;
  bool is_eof() { return _eof == -1; }
  _in() { _eof = false; }
  _in &operator>>(int &x) {
    _eof = scanf("%d", &x);
    return *this;
  }
  _in &operator>>(bool &x) {
    _eof = scanf("%d", &x);
    return *this;
  }
  _in &operator>>(long long &x) {
    _eof = scanf("%I64d", &x);
    return *this;
  }
  _in &operator>>(float &x) {
    _eof = scanf("%f", &x);
    return *this;
  }
  _in &operator>>(double &x) {
    _eof = scanf("%lf", &x);
    return *this;
  }
  _in &operator>>(char &c) {
    _eof = scanf(" %c", &c);
    return *this;
  }
  _in &operator>>(char *s) {
    _eof = scanf("%s", s);
    return *this;
  }
  _in &operator>>(string &s) {
    _eof = scanf("%s", buff);
    s = string(buff, strlen(buff));
    return *this;
  }
} in;
struct _out {
  int _eof;
  bool is_eof() { return _eof == -1; }
  _out() { _eof = false; }
  _out &operator<<(int x) {
    printf("%d", x);
    return *this;
  }
  _out &operator<<(size_t x) {
    printf("%d", x);
    return *this;
  }
  _out &operator<<(long long x) {
    printf("%I64d", x);
    return *this;
  }
  _out &operator<<(float x) {
    printf("%f", x);
    return *this;
  }
  _out &operator<<(double x) {
    printf("%lf", x);
    return *this;
  }
  _out operator<<(char c) {
    printf("%c", c);
    return *this;
  }
  _out &operator<<(string &s) {
    printf("%s", s.c_str());
    return *this;
  }
  _out &operator<<(char *s) {
    printf("%s", s);
    return *this;
  }
} out;
struct _fin {
  FILE *in;
  int _eof;
  bool is_eof() { return _eof == -1; }
  _fin() {
    _eof = false;
    in = fopen("input.txt", "r");
  }
  _fin &operator>>(int &x) {
    _eof = fscanf(in, "%d", &x);
    return *this;
  }
  _fin &operator>>(bool &x) {
    _eof = fscanf(in, "%d", &x);
    return *this;
  }
  _fin &operator>>(long long &x) {
    _eof = fscanf(in, "%I64d", &x);
    return *this;
  }
  _fin &operator>>(float &x) {
    _eof = fscanf(in, "%f", &x);
    return *this;
  }
  _fin &operator>>(double &x) {
    _eof = fscanf(in, "%lf", &x);
    return *this;
  }
  _fin &operator>>(char &c) {
    _eof = fscanf(in, " %c", &c);
    return *this;
  }
  _fin &operator>>(char *s) {
    _eof = fscanf(in, "%s", s);
    return *this;
  }
  _fin &operator>>(string &s) {
    _eof = fscanf(in, "%s", buff);
    s = string(buff, strlen(buff));
    return *this;
  }
} fin;
struct _fout {
  FILE *out;
  int _eof;
  bool is_eof() { return _eof == -1; }
  _fout() {
    _eof = false;
    out = fopen("output.txt", "w");
  }
  _fout &operator<<(int x) {
    fprintf(out, "%d", x);
    return *this;
  }
  _fout &operator<<(size_t x) {
    fprintf(out, "%d", x);
    return *this;
  }
  _fout &operator<<(long long x) {
    fprintf(out, "%I64d", x);
    return *this;
  }
  _fout &operator<<(float x) {
    fprintf(out, "%f", x);
    return *this;
  }
  _fout &operator<<(double x) {
    fprintf(out, "%lf", x);
    return *this;
  }
  _fout operator<<(char c) {
    fprintf(out, "%c", c);
    return *this;
  }
  _fout &operator<<(string &s) {
    fprintf(out, "%s", s.c_str());
    return *this;
  }
  _fout &operator<<(char *s) {
    fprintf(out, "%s", s);
    return *this;
  }
} fout;
int main() {
  int n;
  in >> n;
  long long sx = 0, sy = 0, s2 = 0;
  for (int i = n; i > 0; i--) {
    int x, y;
    in >> x >> y;
    sx += x;
    s2 += x * x;
    sy += y;
    s2 += y * y;
  }
  const int N = 60000000;
  int *arr;
  arr = new int[N];
  double tmp;
  arr[0] = 1;
  arr[2] = 1;
  arr[3] = 2;
  for (int i = 4; i < N; ++i) {
    arr[i] = arr[i - 1] + arr[i - 2];
    tmp = pow(2.0, 64);
  }
  for (int i = 4; i < N; ++i) {
    arr[i] = arr[i - 1] + arr[i - 2];
    tmp = pow(2.0, 64);
  }
  out << (n * s2 - sx * sx - sy * sy) << '\n';
  return 0;
}
