#include<iostream>
#include<cmath>
using namespace std;

struct point{
    int x;
    int y;
};

int dist2(point A, point B){
    return abs(A.x - B.x)*abs(A.x - B.x) + abs(A.y - B.y)*abs(A.y - B.y);
}

int main(){
    int n, total = 0;
    cin >> n;
    point points[n];
    for(int i = 0; i < n; i++){
        cin >> points[i].x >> points[i].y;
    }
    for(int i = 0; i < n; i++){
        for(int j = i; j < n; j++){
            total += dist2(points[i], points[j]);
        }
    }
    cout << total;
    return 0;
}
