#include<stdio.h>
#include<stdlib.h>

struct point{
    int x;
    int y;
}point;

int count_sum(int *array_x, int *array_y, int index, int N){
    int sum=0;

    for(int counter=1; counter<N-index; counter++){
        int number_x;
        int number_y;

        if(array_x[index] > array_x[index+counter]){
            number_x = array_x[index]-array_x[index+counter];
        }else{
            number_x = array_x[index+counter]-array_x[index];
        }

        if(array_y[index] > array_y[index+counter]){
            number_y = array_y[index]-array_y[index+counter];
        }else{
            number_y = array_y[index+counter]-array_y[index];
        }

        sum += number_x*number_x + number_y*number_y;
    }

    return sum;
}

int main(){
    int N;
    scanf("%d", &N);

    int array_x[N];
    int array_y[N];

    int sum=0;

    for(int i=0; i<N; i++){
        scanf("%d", &point.x);
        scanf("%d", &point.y);

        array_x[i]=point.x;
        array_y[i]=point.y;
    }

    for(int i=0; i<N; i++){
        sum += count_sum(array_x, array_y, i, N);
    }

    printf("%d", sum);

    return 0;
}
