#include<iostream>
using namespace std;
const int MAX = 1e5 + 3;


struct point
{
    int x, y;
} arr[MAX];

long long memo[10003][10003];

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin >> n;

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

    long long best_dist = 0;
    for(int i = 0;i < n;i++)
    {
        for(int j = i + 1;j < n;j++)
        {

            long long rx = (arr[i].x - arr[j].x);
            long long ry = (arr[i].y - arr[j].y);
            if(memo[rx][ry])
            {
                best_dist += memo[rx][ry];
                continue;
            }

            long long curr_dist = rx*rx + ry*ry;
            memo[rx][ry] = curr_dist;
            best_dist += curr_dist;
        }
    }

    cout << best_dist;

    return 0;
}
