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

int mod(int a){return a < 0 ? -a : a;}

int memo[MAX];

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

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);

            int index = mod(rx) + mod(ry);
            if(memo[index])
            {
                best_dist += memo[index];
                continue;
            }
           
            long long curr_dist = rx*rx + ry*ry;
            memo[index] = curr_dist;
            best_dist += curr_dist;
        }
    }

    cout << best_dist;

    return 0;
}
