def calc_median(A): N = len(A) L = (N-1) // 2 R = N // 2 return (A[L], A[R]) N = int(input()) X = [] Y = [] for _ in range(N): x, y = map(int, input().split()) X.append(x) Y.append(y) X.sort() Y.sort() xm = calc_median(X)[0] ym = calc_median(Y)[0] ans = 0 for x, y in zip(X, Y): ans += abs(x - xm) + abs(y - ym) print(ans)