#include <math.h>
#include <algorithm>
#include <iostream>
using namespace std;


struct point
{
    short int x,y;
};

int distance_p(struct point a,struct point b)
{
    int c = abs(a.y-b.y);
    int d = abs(a.x-b.x);
    return c*c+d*d;
}

int main()
{
    int n;
    cin >> n;

    struct point arr[n];

    for(int i=0; i<n;i++)
        cin >> arr[i].x >> arr[i].y;

    int res=0;
    for(int i=0; i<n;i++)
        for(int j=i+1; j<n;j++)
            res+=distance_p(arr[i],arr[j]);

    cout << res;
    return 0;
}
