from itertools import product



N = int(eval(input()))

*V, = list(map(int, input().split()))

*C, = list(map(int, input().split()))



ans = -10**18

for p in product([0, 1], repeat=N):

    res = 0

    for i, e in enumerate(p):

        if e:

            res += V[i] - C[i]

    ans = max(ans, res)

print(ans)
N = int(eval(input()))

*V, = list(map(int, input().split()))

*C, = list(map(int, input().split()))



ans = 0

for v, c in zip(V, C):

    if v > c:

        ans += v-c

print(ans)
from itertools import product

N = int(eval(input()))
(*V,) = list(map(int, input().split()))
(*C,) = list(map(int, input().split()))
ans = -(10**18)
for p in product([0, 1], repeat=N):
    res = 0
    for i, e in enumerate(p):
        if e:
            res += V[i] - C[i]
    ans = max(ans, res)
print(ans)

N = int(eval(input()))
(*V,) = list(map(int, input().split()))
(*C,) = list(map(int, input().split()))
ans = 0
for v, c in zip(V, C):
    if v > c:
        ans += v - c
print(ans)

-from itertools import product - -ans = -(10**18) -for p in product([0, 1], repeat=N): -    res = 0 -    for i, e in enumerate(p): -        if e: -            res += V[i] - C[i] -    ans = max(ans, res) +ans = 0 +for v, c in zip(V, C): +    if v > c: +        ans += v - c