#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int dist(int pointAX, int pointAY, int pointBX, int pointBY){
    return pow(pointAX - pointBX, 2) + pow(pointAY - pointBY, 2);
}

int secondPower(size_t sizeArr, int *a, int *b){
    int result = 0;
    for(int i = 0; i < sizeArr; i++){
        for(int j = i+1; j < sizeArr; j++){
            if(a[i] == a[j] && b[i] == b[j]){

            }else{
                result += dist(a[i], b[i], a[j], b[j]);
            }
        }
    }
    return result;
}

int main()
{
    int points = 0;
    scanf("%d", &points);
    int arr[2][points];
    for(int i = 0; i < points; i++){
        scanf("%d %d", &arr[0][i], &arr[1][i]);
    }
    printf("%d", secondPower(points, arr[0], arr[1]));
    return 0;
}
