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

struct point{
    int x;
    int y;
};

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

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;
}
