#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;
        if(i > 0)
        {
            for(int j = i; j >= 0; j--)
            {
                sum += abs(points[i].first - points[j].first) * abs(points[i].first - points[j].first) + abs(points[i].second - points[j].second) * abs(points[i].second - points[j].second);
            }
        }
    }
    cout << sum;
    return 0;
}
