#include<bits/stdc++.h>
using namespace std;
struct Point {
    int x, y;
};
int ras(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);
}
Point points[100004];
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;
    }
    int sum = 0;
    for(int i = 0 ;i < n; i++){
        for(int j = i + 1 ; j < n; j++){
            sum += ras(points[i], points[j]);
        }
    }
    cout << sum << "\n";


    return 0;
}