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

struct point{
    int x;
    int 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 += abs(points[i].x - points[j].x)*abs(points[i].x - points[j].x) + abs(points[i].y - points[j].y)*abs(points[i].y - points[j].y);
        }
    }
    cout << total;
    return 0;
}
