N = int(input()) XY = [list(map(int, input().split())) for _ in range(N)] X = [] Y = [] for x,y in XY: X.append(x) Y.append(y) X.sort() Y.sort() xh = X[N//2] yh = Y[N//2] S = 0 for x,y in XY: S+=abs(x-xh)+abs(y-yh) print(S)