import itertools def solve(N, XY): ans = 10 ** 9 for xc, yc in itertools.product(range(-310, 310), repeat=2): s = sum(abs(xi - xc) + abs(yi - yc) for xi, yi in XY) ans = min(s, ans) return ans N = int(input()) XY = [[int(x) for x in input().split()] for _ in range(N)] print(solve(N, XY))