1 2 3 4
from sys import stdin left, right = zip(*((int(a), int(b)) for a, b in map(str.split, stdin))) print(sum(map(abs, map(int.__sub__, sorted(left), sorted(right)))))