N = int(input()) A = [list(map(int, input().split())) for _ in range(N)] X = sorted(a[0] for a in A) Y = sorted(a[1] for a in A) x = X[N//2] y = Y[N//2] ans = sum(abs(x-a) for a in X)+sum(abs(y-a) for a in Y) print(ans)