#include<bits/stdc++.h>
using namespace std;
const int N = 100000;
pair<int, int> points[N];
int n;
unsigned long long sum;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    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;
}

