#include<bits/stdc++.h>
using namespace std;
const long long maxN = 100006;
struct Point {
    long long x, y;
};
unsigned long long kvX, kvY;
long long sumsX[maxN], sumsY[maxN];
long long sX = 0, sY = 0;
Point points[maxN];
int main () {
    ios_base::sync_with_stdio();
    cin.tie(0);
    int n;
    cin >> n;
    for(int i = 0; i < n ; i ++){
        cin >> points[i].x >> points[i].y;
    }
    for(int i = 0 ;i < n; i++){
        kvX += points[i].x*points[i].x*(n - 1);
        kvY += points[i].y*points[i].y*(n - 1);
        if(i > 0){
            sX += points[i].x*2*sumsX[i - 1];
            sY += points[i].y*2*sumsY[i - 1];
            sumsX[i] = sumsX[i - 1] + points[i].x;
            sumsY[i] = sumsY[i - 1] + points[i].y;
        }else{
            sumsX[0] = points[0].x;
            sumsY[0] = points[0].y;
        }
    }
    long long result = - sX- sY + kvX + kvY;
    cout << result << "\n";


    return 0;
}