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() ans=(sum(abs(x1-x0) for x0,x1 in zip(X,X[::-1]))+sum(abs(y1-y0) for y0,y1 in zip(Y,Y[::-1])))//2 print(ans)