import statistics n = int(input()) X = [] Y = [] for i in range(n): x, y = map(int, input().split()) X.append(x) Y.append(y) xm = statistics.median(X) ym = statistics.median(Y) ans = 0 for i in range(n): ans += abs(X[i] - xm) + abs(Y[i] - ym) print(ans)