#include <iostream>
#include <cstdlib>

using namespace std;

struct point
{
    int x, y;
};

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

    struct point *input = (struct point* )malloc(sizeof(struct point *) * n);
    long long result = 0;
    for(int i=0; i<n;i++)
    {
        cin >> input[i].x >> input[i].y;
    }

    for(int i = 0; i<n; i++)
    {
        for(int j = i+1; j<n; j++)
        {
            int a = input[i].x - input[j].x, b = input[i].y - input[j].y;
            result += a*a + b*b;
        }
    }

    cout << result;
    return 0;
}