import itertools



n=int(eval(input()))

lis=[list(map(int,input().split())) for _ in range(2)]

ans=0



for li in itertools.product([0,1], repeat=n):

  v=0

  for id,l in enumerate(li):

    if l:

      v += lis[0][id] - lis[1][id]

      

  if v > ans:

    ans=v

    

print(ans)
n,a=int(eval(input())),0

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

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

ans=[0 for _ in range(n)]



for i in range(n):

  ans = V[i] - C[i]

  if ans > 0:

    a += ans

  

print(a)
import itertools

n = int(eval(input()))
lis = [list(map(int, input().split())) for _ in range(2)]
ans = 0
for li in itertools.product([0, 1], repeat=n):
    v = 0
    for id, l in enumerate(li):
        if l:
            v += lis[0][id] - lis[1][id]
    if v > ans:
        ans = v
print(ans)

n, a = int(eval(input())), 0
V = list(map(int, input().split()))
C = list(map(int, input().split()))
ans = [0 for _ in range(n)]
for i in range(n):
    ans = V[i] - C[i]
    if ans > 0:
        a += ans
print(a)

-import itertools - -n = int(eval(input())) -lis = [list(map(int, input().split())) for _ in range(2)] -ans = 0 -for li in itertools.product([0, 1], repeat=n): -    v = 0 -    for id, l in enumerate(li): -        if l: -            v += lis[0][id] - lis[1][id] -    if v > ans: -        ans = v -print(ans) +n, a = int(eval(input())), 0 +V = list(map(int, input().split())) +C = list(map(int, input().split())) +ans = [0 for _ in range(n)] +for i in range(n): +    ans = V[i] - C[i] +    if ans > 0: +        a += ans +print(a)