#include <stdio.h>
#include <stdlib.h>
#define a(x1, x2) abs(x1 - x2) * abs(x1 - x2)
#define b(y1, y2) abs(y1 - y2) * abs(y1 - y2)
int X[100000];
int Y[100000];
int main()
{
    int n, sum = 0, k, i;
    scanf("%d", &n);
    for(i = 0;i < n;i++)
    {
        scanf("%d", &X[i]);
        scanf("%d", &Y[i]);
    }
    for(int i = 0;i < n;i++)
    {
        for(k = i + 1;k < n;k++)
        {
            sum += a(X[i], X[k]) + b(Y[i], Y[k]);
        }
    }
    printf("%d\n", sum);
    return 0;
}
