CodeEff/ECCO huggingface dataset:
# Original solution
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)

# Optimized solution
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)
# Original solution
n = int(eval(input()))
v = list(map(int,input().split()))
c = list(map(int,input().split()))
bit = 0b0

ans = 0
for i in range(2**n):
    bag = []
    cost = []
    for j in range(n):
        if(((bit >> j) & 1) == 1):
            bag.append(v[j])
            cost.append(c[j])
        else:
            bag.append(0)
            cost.append(0)
    p = sum(bag) - sum(cost)
    if(p > ans):
        ans = p
    bit += 1
print(ans)

# Optimized solution
n = int(eval(input()))
v = list(map(int,input().split()))
c = list(map(int,input().split()))
bag = 0
for i in range(n):
    if(c[i] <= v[i]):
        bag += v[i] - c[i]
print(bag)
# Original solution
N = int(eval(input()))
V = [int(x.strip()) for x in input().split()]
C = [int(x.strip()) for x in input().split()]

Z = [0 for i in range(2**N)]

for i in range(1, 2**N):
    select = []
    temp = i
    for n in reversed(list(range(1, N+1))):
        if temp - 2**(n-1) >= 0:
            temp = temp - 2**(n-1)
            select.append(n-1)
    Z[i] = sum([V[j] for j in select]) - sum([C[j] for j in select])
print((max(Z)))

# Optimized solution
N = int(eval(input()))
V = [int(x.strip()) for x in input().split()]
C = [int(x.strip()) for x in input().split()]

Z = [V[i] - C[i] for i in range(N)]
print((sum([z for z in Z if z > 0])))
# Original solution
import itertools
n = int(eval(input()))
v = list(map(int, input().split()))
c = list(map(int, input().split()))
xy = []
for i in range(1,n+1):
    for h in itertools.combinations(list(range(0,n)),i):
        x = 0
        y = 0
        for j in h:
            x += v[j]
            y += c[j]
        xy.append(x-y)
if max(xy) < 0:
    print((0))
else:
    print((max(xy)))

# Optimized solution
import itertools
n = int(eval(input()))
v = list(map(int, input().split()))
c = list(map(int, input().split()))
xy = 0
for i in range(1,n+1):
    for h in itertools.combinations(list(range(0,n)),i):
        x = 0
        y = 0
        for j in h:
            x += v[j]
            y += c[j]
        if xy < x-y:
            xy = x-y
print(xy)
# Original solution
n = int(eval(input()))
V = list(map(int,input().split()))
C = list(map(int,input().split()))
s = []
for i in range(n):
    s.append(V[i]-C[i])
s.sort(reverse=True)
res = 0
for a in s:
    if a >= 0:
        res += a
print(res)


# Optimized solution
n = int(eval(input()))
V = list(map(int,input().split()))
C = list(map(int,input().split()))
res = 0
for i in range(n):
	s = V[i] - C[i] 
	if s > 0:
		res += s
print(res)
# Original solution
n = int(eval(input()))
v = list(map(int, input().split()))
c = list(map(int, input().split()))
result = 0
for i in range(n):
  if v[i] > c[i]:
    result += v[i] - c[i]
print(result)

# Optimized solution
N = int(eval(input()))
V = list(map(int, input().split()))
C = list(map(int, input().split()))
print((sum([V[i] - C[i] for i in range(N) if V[i] > C[i]])))
# Original solution
n = int(eval(input()))
v = [num for num in map(int, input().split())]
c = [num for num in map(int, input().split())]

ans = 0

for i in range(n):
  val = v[i] - c[i]
  if val > 0:
    ans += val

print(ans)

# Optimized solution
n = int(eval(input()))
v = list(map(int, input().split()))
c = list(map(int, input().split()))

ans = 0
for i in range(n):
  if v[i] > c[i]:
    ans += v[i] - c[i]
print(ans)
# Original solution
N = int(eval(input()))
V = list(map(int, input().split()))
C = list(map(int, input().split()))

D = [V[i] - C[i] for i in range(N)]
ans = 0
for i in range(N):
  if D[i] > 0: ans += D[i]

print(ans)

# Optimized solution
N = int(eval(input()))
V = list(map(int, input().split()))
C = list(map(int, input().split()))
 
ans = 0
for i in range(N):
  tmp = V[i] - C[i]
  if tmp > 0: ans += tmp

print(ans)
# Original solution
n = int(eval(input()))
v = list(map(int, input().split()))
c = list(map(int, input().split()))
ans = 0
for i in range(2**n):
    # test = []
    X, Y = 0, 0
    for j in range(n):
        if (i >> j) & 1 == 1:
            X += v[j]
            Y += c[j]
            # test.append([v[j], c[j]])
    if ans < X - Y:
        ans = X - Y
    # print(test)

print(ans)

# Optimized solution
n = int(eval(input()))
v = list(map(int, input().split()))
c = list(map(int, input().split()))
ans = 0
for vi, ci in zip(v, c):
    if vi >= ci:
        ans += vi - ci

print(ans)
# Original solution
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)

# Optimized solution
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)
# Original solution
import itertools


def bit_patterns(n):
    return list(itertools.product(list(range(2)), repeat=n))


def actual(n, V, C):
    diff_list = []

    for bit_pattern in bit_patterns(n):
        values = sum([bit * value for bit, value in zip(bit_pattern, V)])
        costs = sum([bit * cost for bit, cost in zip(bit_pattern, C)])

        diff_list.append(values - costs)

    return max(diff_list)

n = int(eval(input()))
V = list(map(int, input().split()))
C = list(map(int, input().split()))

print((actual(n, V, C)))

# Optimized solution
def actual(n, V, C):
    # 購入するとプラスになるものだけ買って合計でおk
    sale_jewels = []

    for v, c in zip(V, C):
        if v - c > 0:
            sale_jewels.append(v - c)

    return sum(sale_jewels)

    # return sum([v - c for v, c in zip(V, C) if v - c > 0])


n = int(eval(input()))
V = list(map(int, input().split()))
C = list(map(int, input().split()))

print((actual(n, V, C)))
# Original solution
import itertools
n=int(eval(input()))
v=[int(i) for i in input().split()]
c=[int(i) for i in input().split()]
ans=[v[i]-c[i] for i in range(n)]+[0]
x=[i for i in range(n)]

for i in range(2,n):
    for z in itertools.combinations(x, i):
        A=0
        for y in z:
            A+=v[y]-c[y]
        ans+=[A]
print((max(ans)))

# Optimized solution
n=int(eval(input()))
v=[int(i) for i in input().split()]
c=[int(i) for i in input().split()]
ans=[v[i]-c[i] for i in range(n)]
ans.sort(reverse=True)
A=0
for i in ans:
    if i>0:
        A+=i
    else:
        break
print(A)
# Original solution

N = int(eval(input()))
V = list(map(int, input().split()))
C = list(map(int, input().split()))

ans = []
for i in range(0, 2 ** N):
    x = 1
    a = 0
    for n in range(N):
        if i & x:
            a += V[n] - C[n]
        x = x << 1
    ans.append(a)
print((max(ans)))

# Optimized solution

N = int(eval(input()))
V = list(map(int, input().split()))
C = list(map(int, input().split()))

ans = 0
for i in range(N):
    x = V[i] - C[i]
    if x > 0:
        ans += x
print(ans)
# Original solution
n = int(eval(input()))
V = list(map(int, input().split()))
C = list(map(int, input().split()))
from itertools import product
max_total = 0
for lis in product((0, 1), repeat=n):
  total = 0
  for i, zero_one in enumerate(lis):
    total += (V[i]-C[i]) * zero_one
  max_total = max(max_total, total)
print(max_total)

# Optimized solution
n = int(eval(input()))
V = list(map(int, input().split()))
C = list(map(int, input().split()))
total = 0
for i in range(n):
  if V[i] - C[i] > 0:
    total += V[i] - C[i]
print(total)
# Original solution
from itertools import product
n = int(eval(input()))
v = list(map(int, input().split()))
c = list(map(int, input().split()))

a = list(product([0, 1], repeat=n))
m = 0
xsum = 0
ysum = 0

for i in range(len(a)):
    for j in range(n):
        if a[i][j] == 1:
            xsum += v[j]
            ysum += c[j]
    difxy = xsum - ysum
    if difxy > m:
        m = difxy
    xsum = 0
    ysum = 0

print(m)


# Optimized solution
n = int(eval(input()))
v = list(map(int, input().split()))
c = list(map(int, input().split()))

m = 0
for i in range(n):
    difxy = v[i] - c[i]
    if difxy > 0:
        m += difxy

print(m)
# Original solution
N = int(eval(input()))
V = list(map(int, input().split()))
C = list(map(int, input().split()))

# 2進数のカウンターを使って全探索する

ans = 0
cnt = 0 # カウンター

def get_value(b):
    """
    バイナリ値bを受け取り、X-Yを計算する
    """
    X = 0
    Y = 0
    for i in range(N):
        if b[i] == "1":
            X += V[i]
            Y += C[i]
    return X - Y

while cnt < 2 ** N:
    b = bin(cnt)[2:]
    ans = max(ans, get_value("0" * (N - len(b)) + b))
    cnt += 1

print(ans)

# Optimized solution
N = int(eval(input()))
V = list(map(int, input().split()))
C = list(map(int, input().split()))

# V_i > C_iなら選ぶ

ans = 0 # 価値の合計

for i in range(N):
	if V[i] > C[i]:
		ans += V[i] - C[i]

print(ans)
# Original solution
def weight( n, lst ):
    l = len(lst)
    wei = 0
    for i in range(N):
        if n % 2 == 1:
            wei += lst[l-i-1] 
        n  = n // 2
    return wei

N = int(eval(input()))
Vlist = list(map(int,input().split()))
Clist = list(map(int,input().split()))

maxval = 0
for i in range(2 ** N):
    vsum = weight(i,Vlist)
    csum = weight(i,Clist)
    gain = vsum - csum
    if i == 0:
        maxval = gain
    else:
        if maxval < gain:
            maxval = gain

print(maxval)

# Optimized solution
N = int(eval(input()))
Vlist = list(map(int,input().split()))
Clist = list(map(int,input().split()))
sum1 = 0
for i in range(N):
    x = Vlist[i]
    c = Clist[i]
    if x - c > 0:
        sum1 += (x-c)
print(sum1)
# Original solution
import itertools

N = int(eval(input()))
V = list(map(int, input().split()))
C = list(map(int, input().split()))

n = [i for i in range(N)]
ind = []
for i in range(1, N + 1):
    ind += list(itertools.combinations(n, i))

# print(ind)

M = len(ind)
ans = 0
for val in ind:
    X = 0
    Y = 0
    for v in val:
        X += V[v]
        Y += C[v]
        c = X - Y
    ans = max(ans, c)
print(ans)

# Optimized solution
N = int(eval(input()))
V = list(map(int, input().split()))
C = list(map(int, input().split()))

ans = 0
for i in range(N):
    X = V[i] - C[i]
    if X > 0:
        ans += X
print(ans)
# Original solution
N = int(eval(input()))
V = list(map(int, input().split()))
C = list(map(int, input().split()))

import itertools

#n桁のm値のbitを生成
def bit(n, m):
    bit_list = list(itertools.product([i for i in range(m)], repeat=n))
    return bit_list

bts = bit(N, 2)

res = 0
for b in bts:
    tmp = 0
    for i in range(N):
        if b[i] == 0:
            tmp += V[i] - C[i]
            
    if tmp > res:
        res = tmp
        
print(res)
    

# Optimized solution
N = int(eval(input()))
V = list(map(int, input().split()))
C = list(map(int, input().split()))

tmp = [0 for _ in range(N)]

for i in range(N):
    tmp[i] = V[i] - C[i]
  
res = 0
for i in range(N):
    if tmp[i] > 0:
        res += tmp[i]
            
        
print(res)
# Original solution
import itertools

n = int(eval(input())) 
v = list(map(int, input().split()))
c = list(map(int, input().split()))

l = [True, False]
max_diff_v_c = 0
for flags in itertools.product(l, repeat=n):
    # print(' '.join(map(str, flags)))
    
    sum_v = 0
    sum_c = 0
    for i in range(len(flags)):
        if flags[i]:
            sum_v += v[i]
            sum_c += c[i]

    diff_v_c = sum_v - sum_c

    if max_diff_v_c < diff_v_c:
        max_diff_v_c = diff_v_c
        
print(max_diff_v_c)

# Optimized solution
n = int(eval(input())) 
v = list(map(int, input().split()))
c = list(map(int, input().split()))

max_diff_v_c = 0
for i in range(n):
    diff_v_c = v[i] - c[i]
    if diff_v_c > 0:
        max_diff_v_c += diff_v_c

print(max_diff_v_c)
# Original solution
def main():
    n = int(eval(input()))
    v = [int(v) for v in input().split()]
    c = [int(c) for c in input().split()]

    max_total = 0
    for i in range(2 ** n):
        total = 0
        for j in range(n):  # このループが一番のポイント
            if ((i >> j) & 1):  # 順に右にシフトさせ最下位bitのチェックを行う
                total += v[j]
                total -= c[j]
        if total > max_total:
            max_total = total
    print(max_total)

if __name__ == '__main__':
    main()


# Optimized solution
def main():
    n = int(eval(input()))
    v = [int(v) for v in input().split()]
    c = [int(c) for c in input().split()]

    total = 0
    for nn in range(n):
        if v[nn] > c[nn]:
            total += v[nn]
            total -= c[nn]
    print(total)

    # max_total = 0
    # for i in range(2 ** n):
    #     total = 0
    #     for j in range(n):  # このループが一番のポイント
    #         if ((i >> j) & 1):  # 順に右にシフトさせ最下位bitのチェックを行う
    #             total += v[j]
    #             total -= c[j]
    #     if total > max_total:
    #         max_total = total
    # print(max_total)

if __name__ == '__main__':
    main()
# Original solution
import itertools
N = int(eval(input()))
value_list = list(map(int, input().split()))
cost_list = list(map(int, input().split()))

value_result = []
for i in range(1,len(value_list)+1):
    for conb in itertools.combinations(value_list, i):
        value_result.append(list(conb)) 

cost_result = []
for i in range(1,len(cost_list)+1):
    for conb in itertools.combinations(cost_list, i):
        cost_result.append(list(conb)) 

ans_list = []
for i in range(len(value_result)):
    ans = sum(value_result[i]) - sum(cost_result[i])
    ans_list.append(ans)

if max(ans_list) > 0:
    print((max(ans_list)))
else:
    print((0))

# Optimized solution
N = int(eval(input()))
value_list = list(map(int, input().split()))
cost_list = list(map(int, input().split()))
total = 0
for i in range(N):
    ans = value_list[i] - cost_list[i]
    if ans > 0:
        total += ans
print(total)
# Original solution
N=int(eval(input()))
V=list(map(int, input().split()))
C=list(map(int, input().split()))
a=[]
for i in range(1<<N):
    tmp=0
    for j in range(N):
        if ((i >> j) & 1) == 1:
          tmp+=V[j]-C[j]
    a.append(tmp)
print((max(a)))

# Optimized solution
N=int(eval(input()))
V=list(map(int, input().split()))
C=list(map(int, input().split()))
a=0
for i in range(N):
    if V[i]-C[i]>0:
        a+=V[i]-C[i]
print(a)
# Original solution
import sys
from bisect import *
from collections import *
from copy import deepcopy
from datetime import *
from heapq import *
from itertools import *
from math import *
from operator import *
from pprint import *

sys.setrecursionlimit(10**8)

input = sys.stdin.readline

def main():
    """ main """
    N = int(eval(input()))
    VS = list(map(int, input().split()))
    CS = list(map(int, input().split()))

    ans = 0
    for bit in range(2**N):
        tmp = 0
        for i in range(N):
            if bit & 1<<i == 0: continue
            tmp += VS[i] - CS[i]
        ans = max(ans, tmp)
    print(ans)

if __name__ == '__main__':
    main()

# Optimized solution
import sys
from bisect import *
from collections import *
from copy import deepcopy
from datetime import *
from heapq import *
from itertools import *
from math import *
from operator import *
from pprint import *

sys.setrecursionlimit(10**8)

input = sys.stdin.readline

def main():
    """ main """
    N = int(eval(input()))
    VS = list(map(int, input().split()))
    CS = list(map(int, input().split()))

    ans = 0
    for i in range(N):
        if VS[i] - CS[i] > 0:
            ans += VS[i] - CS[i]
    print(ans)

if __name__ == '__main__':
    main()
# Original solution
from collections import Counter
from functools import reduce
import bisect
import fractions
import math
import statistics
import sys
import time
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]  # LIST INT
def LF(): return [float(x) for x in sys.stdin.readline().split()]  # LIST FLOAT
def LS(): return sys.stdin.readline().split()  # LIST STRING
def MI(): return map(int, sys.stdin.readline().split())  # MAP INT
def II(): return int(sys.stdin.readline())  # INPUT INT
def IS(): return input()  # INPUT STRING
def P(x): return print(x)
def C(x): return Counter(x)
def GCD_LIST(numbers):  # Greatest Common Divisor
    return reduce(fractions.gcd, numbers)
def LCM_LIST(numbers):  # Least Common Multiple
    return reduce(LCM, numbers)
def LCM(m, n):
    return (m * n // fractions.gcd(m, n))


n = II()
v = LI()
c = LI()
y = 0
maxi = -1000000000000
for i in range(2 ** n):
    total = 0
    y =0
    for j in range(n):
        if ((i >> j) & 1):
            total += v[j]
            y += c[j]
    maxi = max(maxi, total-y)

print(maxi)


# Optimized solution
from collections import Counter
from functools import reduce
import bisect
import fractions
import math
import statistics
import sys
import time
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]  # LIST INT
def LF(): return [float(x) for x in sys.stdin.readline().split()]  # LIST FLOAT
def LS(): return sys.stdin.readline().split()  # LIST STRING
def MI(): return map(int, sys.stdin.readline().split())  # MAP INT
def II(): return int(sys.stdin.readline())  # INPUT INT
def IS(): return input()  # INPUT STRING
def P(x): return print(x)
def C(x): return Counter(x)
def GCD_LIST(numbers):  # Greatest Common Divisor
    return reduce(fractions.gcd, numbers)
def LCM_LIST(numbers):  # Least Common Multiple
    return reduce(LCM, numbers)
def LCM(m, n):
    return (m * n // fractions.gcd(m, n))


n = II()
v = LI()
c = LI()
xy = [v[i] - c[i] for i in range(n)]
print(sum([ xy[i] for i in range(n) if xy[i] > 0]))
# Original solution
N = int(eval(input()))
V = list(map(int,input().split()))
C = list(map(int,input().split()))
ans = 0
for i,j in zip(V,C):
    ans += max(0,i-j)
print(ans)

# Optimized solution
N = int(eval(input()))
V = list(map(int,input().split()))
C = list(map(int,input().split()))
ans = 0
for i in range(N):
    if V[i]-C[i]>0:
        ans += V[i]-C[i]
print(ans)
# Original solution
def dfs(now,val,cost):
    if now == n:
        return val - cost
    else:
        return max(dfs(now+1,val+v[now],cost+c[now]),dfs(now+1,val,cost))

n = int(eval(input()))
v = list(map(int,input().split()))
c = list(map(int,input().split()))

print((dfs(0,0,0)))


# Optimized solution
# def dfs(now,val,cost):
#     if now == n:
#         return val - cost
#     else:
#         return max(dfs(now+1,val+v[now],cost+c[now]),dfs(now+1,val,cost))

n = int(eval(input()))
v = list(map(int, input().split()))
c = list(map(int, input().split()))

# print(dfs(0,0,0))
ans = 0
for i in range(n):
    tmp = v[i] - c[i]
    if tmp > 0:
        ans += tmp
print(ans)
# Original solution
N = int(eval(input()))
V = [int(x) for x in input().split()]
C = [int(x) for x in input().split()]
m = 0
for p in range(2**N):
  value = 0
  for i in range(N):
    if ((p>>i) & 1):
      value = value + V[i] - C[i]
  if value > m:
    m = value
print(m)

# Optimized solution
N = int(eval(input()))
V = [int(x) for x in input().split()]
C = [int(x) for x in input().split()]
m = 0
for i in range(N):
  if (V[i]-C[i]) > 0:
    m = m + V[i]-C[i]
print(m)
# Original solution
n = int(eval(input()))
v = list(map(int,input().split()))
c = list(map(int,input().split()))

max_z = 0
for i in range(2**n):
  #print("i:",i)
  x = 0
  y = 0
  for j in range(n):
    if i&(1<<j)!=0:
      #print('j:',j)
      x+=v[j]
      y+=c[j]
  z=x-y
  #print(z)
  max_z = max(max_z,z)
print(max_z)
  


# Optimized solution
n = int(eval(input()))
v = list(map(int,input().split()))
c = list(map(int,input().split()))

z=0
for i in range(n):
  if v[i]>c[i]:
    z+=v[i]-c[i]
print(z)
# Original solution
#!/usr/bin/env python3
n = int(eval(input()))
v = list(map(int, input().split()))
c = list(map(int, input().split()))
x = 0
y = 0
for i in range(n):
    if v[i] >= c[i]:
        x += v[i]
        y += c[i]
print((x - y))


# Optimized solution
#!/usr/bin/env python3
n = int(eval(input()))
v = list(map(int, input().split()))
c = list(map(int, input().split()))
ans = 0
for i in range(n):
    if v[i] >= c[i]:
        ans += v[i] - c[i]
print(ans)
# Original solution
N=int(eval(input()))
V=list(map(int,input().split()))
C=list(map(int,input().split()))
from itertools import combinations
List=[]
for i in range(N):
    List.append(i)
ans=[]
for i in range(1,N+1):
    for j in list(combinations(List,i)):
        tmp=0
        for k in j:
            tmp+=V[k]-C[k]
        if tmp<0:
            tmp=0
        ans.append(tmp)    
print((max(ans)))

# Optimized solution
N=int(eval(input()))
V=list(map(int,input().split()))
C=list(map(int,input().split()))
ans=0
for i in range(N):
    if V[i]>=C[i]:
        ans+=V[i]-C[i]
print(ans)
# Original solution
N = int(eval(input()))
V = list(map(int, input().split()))
C = list(map(int, input().split()))
lst = []

for i in range(N):
	if V[i] > C[i]:
		lst.append(V[i] - C[i])
N = len(lst)
  
high_score = 0

if N > 0:

	  
	for i in range(2 ** N):
		a = list(str(bin(i))[2:])
		for k in range(N - len(a)):
			a.insert(0, "0")
		b = list(map(int, a))
		score = 0
		for j in range(len(b)):
			score += lst[j] * b[j]
		if high_score < score:
			high_score = score
		
print(high_score)

# Optimized solution
N = int(eval(input()))
V = list(map(int, input().split()))
C = list(map(int, input().split()))
lst = []

for i in range(N):
	if V[i] > C[i]:
		lst.append(V[i] - C[i])

print((sum(lst)))
# Original solution
def main():
    N = int(eval(input()))
    V = list(map(int, input().split()))
    C = list(map(int, input().split()))
    arr = []
    ans = []
    for i in range(N):
        arr.append(V[i]-C[i])
    for j in range(1 << N):
        output = []
        for k in range(N):
            if ((j >> k) & 1) == 1:
                output.append(arr[k])
            ans.append(sum(output))
    if max(ans) < 0:
        print((0))
        return
    print((max(ans)))
main()

# Optimized solution
def main():
    N = int(eval(input()))
    V = list(map(int, input().split()))
    C = list(map(int, input().split()))
    ans = 0
    for i in range(N):
        ans += max(V[i]-C[i], 0)
    print(ans)
if __name__ == '__main__':
    main()
# Original solution
# -*- coding: utf-8 -*-
n = int(eval(input()))
vs = list(map(int, input().split()))
cs = list(map(int, input().split()))
value = 0
for d in [vs[i] - cs[i] for i in range(n)]:
  if d > 0:
    value = value + d
print(value)


# Optimized solution
# -*- coding: utf-8 -*-
n = int(eval(input()))
vs = list(map(int, input().split()))
cs = list(map(int, input().split()))
print((sum(d for d in [vs[i] - cs[i] for i in range(n)] if d > 0)))
# Original solution
n = int(eval(input()))
v = list(map(int, input().split()))
c = list(map(int, input().split()))

ans = 0
for i in range(1 << n):
    value = 0
    cost = 0
    for j in range(n):
        if i >> j & 1:
            value += v[j]
            cost += c[j]
    ans = max(ans, value - cost)

print(ans)

# Optimized solution
n = int(eval(input()))
v = list(map(int, input().split()))
c = list(map(int, input().split()))

ans = 0
for i in range(n):
    if v[i] > c[i]:
        ans += v[i] - c[i]

print(ans)
# Original solution
N = int(eval(input()))
V = list(map(int,input().split()))
C = list(map(int,input().split()))

ans = 0
for i in range(2**N):
    X=0
    Y=0
    for j in range(N):
        if((i>>j)&1):
            X+=V[j]
            Y+=C[j]
        if X-Y>ans:
            ans = X-Y
print(ans)

# Optimized solution
N = int(eval(input()))
V = list(map(int,input().split()))
C = list(map(int,input().split()))
V_C = [V[i]-C[i] for i in range(N)]
ans = 0
for i in range(N):
    if V_C[i]>0:
        ans += V_C[i]
print(ans)