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

float secondPower(size_t sizeArr, int *a, int *b){
    float result = 0;
    for(int i = 0; i < sizeArr; i++){
        for(int j = i+1; j < sizeArr; j++){
            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("%f", secondPower(points, arr[0], arr[1]));
    return 0;
}
