#include <stdio.h>
#include <stdint.h>

typedef struct Point Point;
struct Point {
	int64_t x;
	int64_t y;
};

int64_t n;
Point points[100000];

int64_t dist(int64_t i, int64_t j) {
	int64_t dx = points[i].x - points[j].x;
	int64_t dy = points[i].y - points[j].y;
	return dx * dx + dy * dy;
}

int main() {
	scanf("%lld", &n);
	for (int64_t i = 0; i < n; ++i)
		scanf("%lld%lld", &points[i].x, &points[i].y);
	
	int64_t ans = 0;
	
	for (int64_t i = 0; i < n; ++i)
		for (int64_t j = 0; j < i; ++j)
			ans += dist(i, j);
		
	printf("%lld\n", ans);
}