n = int(input()) a = list(map(int,input().split())) b = list(map(int,input().split())) used = [0] * 2*n t = [(-a[i]-b[i],i) for i in range(2*n)] t.sort() t=t[::-1] f = [(-b[i]-a[i],i) for i in range(2*n)] f.sort() f=f[::-1] x = 0 pivt = 0 pivf = 0 for i in range(n): while pivt < 2*n and used[t[pivt][1]]: pivt += 1 used[t[pivt][1]] = 1 x += a[t[pivt][1]] while pivf < 2*n and used[f[pivf][1]]: pivf += 1 used[f[pivf][1]] = 1 x -= b[f[pivf][1]] print(x)