n=int(input()) x=[] y=[] for i in range(n): a,b=map(int,input().split()) x.append(a) y.append(b) x.sort() y.sort() xmed=x[n//2] ymed=y[n//2] res=0 for i in range(n): res+=abs(x[i]-xmed)+abs(y[i]-ymed) print(res)