#include<bits/stdc++.h>
using namespace std;
const int N = 100000;
pair<int, int> points[N];
int n;
long long sum;
int main()
{
    cin >> n;
    for(int i = 0; i < n; i++)
    {
        cin >> points[i].first >> points[i].second;
    }
    for(int i = 0; i < n; i++)
    {
        for(int j = i + 1; j < n; j++)
        {
            int xDiff = abs(points[i].first - points[j].first);
            int yDiff = abs(points[i].second - points[j].second);
            sum += xDiff * xDiff + yDiff * yDiff;
        }
    }
    cout << sum;
    return 0;
}
