n = int(input()) X,Y = [],[] for i in range(n): x,y = map(int,input().split()) X.append(x) Y.append(y) X.sort() Y.sort() cx,cy = X[n//2],Y[n//2] ans = 0 for x,y in zip(X,Y): ans += abs(x-cx) + abs(y-cy) print(ans)