N, = map(int, input().split()) X = list(map(int, input().split())) Y = list(map(int, input().split())) X.sort() Y.sort() X=X[::-1] R = 0 for i in range(N): x,y=X[i],Y[i] if x>y: R+=x-y print(R)