Problem:
 Score : 200 points    Problem Statement There are N gems. The value of the i -th gem is V_i .  You will choose some of these gems, possibly all or none, and get them.  However, you need to pay a cost of C_i to get the i -th gem.  Let X be the sum of the values of the gems obtained, and Y be the sum of the costs paid.  Find the maximum possible value of X-Y .      Constraints  All values in input are integers.  1 \leq N \leq 20  1 \leq C_i, V_i \leq 50         Input Input is given from Standard Input in the following format:  N  V_1  V_2  ...  V_N  C_1  C_2  ...  C_N       Output Print the maximum possible value of X-Y .        Sample Input 1 3
10 2 5
6 3 4      Sample Output 1 5  If we choose the first and third gems, X = 10 + 5 = 15 and Y = 6 + 4 = 10 .
We have X-Y = 5 here, which is the maximum possible value.       Sample Input 2 4
13 21 6 19
11 30 6 15      Sample Output 2 6       Sample Input 3 1
1
50      Sample Output 3 0

Solution (Python):
N = int(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)

Solution (Python):
n = int(input())
valu = list(map(int,input().split()))
cost = list(map(int,input().split()))

ans = 0

for i in range(n):
    if valu[i] > cost[i]:
        ans += valu[i] - cost[i]
print(ans)

Solution (Python):
N = int(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]]))

Solution (Python):
n = int(input())
values = list(map(int, input().split()))
costs = list(map(int, input().split()))
count = 0
for i in range(n):
    value = values[i] - costs[i]
    if value >= 0:
        count += value
print(count)

Solution (Python):


import sys
input = sys.stdin.readline

def io_generator():
	return input()



def main(io):
	n=int(io())
	v = list(map(int, io().split()))
	c = list(map(int, io().split()))
	t=[vi-ci for vi,ci in zip(v,c) if vi-ci>0]
	ret = sum(t)
	return ret



if __name__ == "__main__":
	io= lambda : io_generator()
	print (main(io))

Solution (Python):
import math
number = input().split()
value_list= input().split()
cost_list= input().split()

answer = 0

for i, value in enumerate(value_list):
    if int(value) > int(cost_list[i]):
        answer = answer + (int(value)-int(cost_list[i]))
    else:
        answer = answer

print(answer)

Solution (Python):
N = int(input())
V = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]
dif = []
for i in range(N):
    dif.append(V[i]-C[i])
ans = 0
for i in range(N):
    if dif[i]>0:
        ans += dif[i]
print(ans)

Solution (Python):
len_lst = input()
val = input()
cos = input()
value = list(map(int, val.split(" ")))
cost = list(map(int, cos.split(" ")))
diff = [value[i] - cost[i] for i in range(int(len_lst))]
plus = [i for i in diff if i>0]
print(sum(plus))

Solution (Python):
n = int(input())
v = list(map(int, input().strip().split()))
c = list(map(int, input().strip().split()))
ans = 0
for i in range(n):
  ans += max(0, v[i]-c[i])
print(ans)

Solution (Python):
n = int(input())
v = list(map(int,input().split()))
c = list(map(int,input().split()))
sum = 0
for i in range(n):
     if v[i] >c[i]:
      sum += v[i]-c[i]
print(sum)

Solution (Python):
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
ans = 0

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

print(ans)

Solution (Python):
N = int(raw_input())
V = map(int,raw_input().split())
C = map(int,raw_input().split())
sum = 0
for i in range(N):
  if V[i] > C[i]:
    sum = sum + (V[i] - C[i])
print sum

Solution (Python):
dia_num = int(input())
diamond = list(map(int,input().split()))
dia_cost = list(map(int,input().split()))
profit = 0

for i in range(dia_num):
    if diamond[i]-dia_cost[i]>0:
        profit += diamond[i]-dia_cost[i]

print(profit)

Solution (Python):
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
c = []
A = 0
for i in range (N):
    if V[i] - C[i] > 0:
        c.append(i)
for j in c:
    A += V[j] - C[j]
print(A)

Solution (Python):
N=int(input())
X=list(map(int,input().split()))
Y=list(map(int,input().split()))
T=0
for i in range(N):
    if X[i]-Y[i] > 0:
        T += X[i]-Y[i]
print(T)

Solution (Python):
N = int(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 = X + V[i]
        Y = Y + C[i]
       
print(X - Y)

Solution (Python):
n=int(input())
V=list(map(int,input().split()))
C=list(map(int,input().split()))
ans = 0
for i in range(n):
    ans += max(0, V[i]-C[i])
print(ans)

Solution (Python):
n = int(input())
x = list(map(int,input().split()))
y = list(map(int,input().split()))
sum = 0
ans = 0
for i in range(n):
	sum = x[i] - y[i]
	if sum >= 0:
		ans = ans + sum
print(ans)

Solution (Python):
n = int(input())
x = list(map(int,input().split()))
y = list(map(int,input().split()))
sum = 0
ans = 0
for i in range(n):
	sum = x[i] - y[i]
	if sum >= 0:
		ans = ans + sum
print(ans)

Solution (Python):
a = int(input())
b = list(map(int,input().split()))
c = list(map(int,input().split()))
X = 0
Y = 0
for i in range(a):
    if b[i] > c[i]:
        X += b[i]
        Y += c[i]
print(X-Y)

Solution (Python):
n = int(input())
v = [int(x) for x in input().split()]
c = [int(x) for x in input().split()]
d = 0
for i in range(n):
    if v[i] > c[i]:
        d = d + v[i] - c[i]
print(d)

Solution (Python):
'''input
1
1
50
'''

N=int(input())
V=list(map(int,input().split()))
C=list(map(int,input().split()))
D=[0]*N
ans=0

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


print(ans)

Solution (Python):
import numpy as np
N = int( input() )
V = np.array( list( map( int, input().split() ) ) ) 
C = np.array( list( map( int, input().split() ) ) ) 

"""
Vi - Ci > 0 ならばその宝石を手に入れることで利益は増える
したがって全ての差を計算して0より大きいもので総和をとれば良い
たかだか N <= 20　回 なのでループで確認する
"""

P = V - C 

ret = 0
for i in range( N ):
    if P[i] > 0:
        ret += P[i]

print( ret )

Solution (Python):
N = int(input())
V = [int(v) for v in input().split()]
C = [int(c) for c in input().split()]
sum = 0

for i in range(N):
    if(V[i]<=C[i]):
        continue
    else:
        sum += V[i]-C[i]
        
print(sum)

Solution (Python):
import numpy as np

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

list = np.array(V) - np.array(C)
print(int(0 + sum(list[list > 0])))

Solution (Python):
N = int(input())
liv = [ int(it) for it in input().split() ]
lic = [ int(it) for it in input().split() ]
s = 0
for i in range(N):
  v,c = liv[i],lic[i]
  if (v>c):
    s += v-c
print (s)

Solution (Python):
n = int(input())
v = [int(i) for i in input().split()]
c = [int(i) for i in input().split()]
print(sum([v[i]-c[i] for i in range(n) if v[i]-c[i]>0]))

Solution (Python):
n = int(input())
v = [int(i) for i in input().split()]
c = [int(i) for i in input().split()]

print(sum([v[i]-c[i]  for i in range(n) if v[i]-c[i]>0]))

Solution (Python):
n = int(input())
v = [int(i) for i in input().split()]
c = [int(i) for i in input().split()]
d = 0
for i in range(n):
    if v[i] >c[i]:
        d = d + v[i] - c[i]
print(d)

Solution (Python):
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))

sum = 0

for i in range(N):
  c = V[i] - C[i]
  if c > 0:
    sum += c
print(sum, "")

Solution (Python):
n = int(input())
v = [int(i) for i in input().split()]
c = [int(i) for i in input().split()]

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

print(res)

Solution (Python):
profit = 0
n = int(input())
v = []
c = []
v += map(int,input().split())
c += map(int,input().split())
a = []
for i in range(n):
    a.append(v[i] - c[i])
for i in range(n):
    if a[i] > 0:
        profit += a[i]
print(profit)

Solution (Python):
import numpy as np
gems = int(input())
values = np.array([_ for _ in map(int, input().split())])
costs = np.array([_ for _ in map(int, input().split())])

cost_effectives = values - costs
print(sum([_ for _ in cost_effectives if _ > 0]))

Solution (Python):
N = int(input())
V = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]
ans = 0
for i in range(N):
    if V[i] > C[i]:
        ans += V[i] - C[i]

print(ans)

Solution (Python):
n = int(input())
v = [int(x) for x in input().split()]
c = [int(x) for x in input().split()]

vc = [(v[i] - c[i]) for i in range(n)]
vc.sort(reverse=True)

result = 0
for profit in vc:
    if profit <= 0:
        break
    result += profit

print(result)

Solution (Python):
n = int(input())
list_v = list(map(int, input().split()))
list_c = list(map(int, input().split()))

max_value = 0

for i in range(n):
    if list_v[i]>list_c[i]:
        max_value = max_value + (list_v[i]-list_c[i])

print(max_value)

Solution (Python):
n = int(input())

value = list(map(int, input().split()))
cost = list(map(int, input().split()))

ans = 0
for j in range(n):
    if value[j] -cost[j] >0:
            ans +=value[j] - cost[j]

print(ans)

Solution (Python):

n = int(input())
value = list(map(int, input().split()))
cost = list(map(int, input().split()))

ans = 0
for j in range(n):
    if value[j] - cost[j] > 0:
        ans += value[j] - cost[j]

print(ans)

Solution (Python):
N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))
df = 0
for i in range(N):
    if V[i] - C[i] > 0:
        df += V[i] - C[i]
print(df)

Solution (Python):
N=int(input())
V=input().split()
C=input().split()
i=0
j=0
s_l=[]
cnt=0
while i<N:
       s=int(V[i])-int(C[i])
       s_l.append(s)
       i+=1
while j<N:
       if s_l[j]>=0:
              cnt+=s_l[j]
       j+=1
print(cnt)

Solution (Python):
N=int(input())
V=list(map(int,input().split()))
C=list(map(int,input().split()))
print(sum([max(V[i]-C[i],0) for i in range(N)]))

Solution (Python):
n = int(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)

Solution (Python):
N=int(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)

Solution (Python):
n = int(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] > 0:
    x += v[i]
    y += c[i]
print(x-y)

Solution (Python):
n = int(input())
v = [int(i) for i in input().split()]
c = [int(i) for i in input().split()]

d = []
for i in range(n):
    dif = v[i] - c[i]
    if dif > 0:
        d.append(dif)

res = 0

for i in d:
    res += i

print(res)

Solution (Python):
n = int(input())
V1 = list(map(int, input().strip().split()))
C1 = list(map(int, input().strip().split()))

sums = 0

for i in range(n):
    if V1[i] - C1[i]>0:
        sums+= V1[i] - C1[i]
print(sums)

Solution (Python):
n = input()
V = map(int, input().split())
C = map(int, input().split())
print(sum(max(0, v - c) for v, c in zip(V, C)))

Solution (Python):
N = int(input())
V = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]
gap = []
for i in range(N):
    tmp = V[i]-C[i]
    if tmp > 0:
        gap.append(tmp)

ans = 0
for i in gap:
    ans += i

print(ans)

Solution (Python):
import numpy as np

N = input()
V = np.array(map(int, raw_input().split()))
C = np.array(map(int, raw_input().split()))

flag_arr = (V-C) > 0

res = 0

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

print(res)

Solution (Python):
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))

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

print(int(answer))

Solution (Python):
def main():
    n = int(input())
    vv = list(map(int, input().split()))
    cc = list(map(int, input().split()))
    res = 0
    for v, c in zip(vv, cc):
        if v > c:
            res += v - c
    print(res)


if __name__ == "__main__":
    main()

Solution (Python):
n = int(input())

values = map(int, input().split())
costs = map(int, input().split())

ans = 0

for value, cost in zip(values, costs):
  if value > cost:
    ans += value - cost
    
print(ans)

Solution (Python):
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))

dp = [[0 for x in range(sum(C)+1)] for x in range(N+1)]

ans = 0
for i in range(N):
    for j in range(sum(C)+1):
        if j < C[i]:
            dp[i+1][j] = dp[i][j]
        else:
            dp[i+1][j] = max(dp[i][j], dp[i][j-C[i]] + (V[i] - C[i]))
            ans = max(ans, dp[i+1][j])
print(ans)

Solution (Python):
def get_next_int():
    return int(float(input()))
def get_next_ints(delim=" "):
    return tuple([int(float(x)) for x in input().split(delim)])

def main():
    n = get_next_int()
    values = get_next_ints()
    costs = get_next_ints()
    
    total = 0
    for value, cost in zip(values, costs):
        if value > cost:
            total += (value - cost)
    
    print(total)
    
if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
v = [int(num) for num in input().split()]
c = [int(num) for num in input().split()]

ans = 0

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

Solution (Python):
n = int(input())
vals = list(map(int, input().split()))
costs = list(map(int, input().split()))

if n == 1:
    print(0)
else:
    total = 0
    for v, c in zip(vals, costs):
        resale = v - c
        if resale > 0:
            total += resale
    print(total)

Solution (Python):
n = int(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)

Solution (Python):
N=int(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]:
    a=a+V[i]-C[i]
    
print(a)

Solution (Python):
def resale(V, C):

    result = 0
    for v, c in zip(V, C):
        if v > c:
            result += v - c
            
    return result


if __name__ == '__main__':
    

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


    print(resale(v,c))

Solution (Python):

"""
Created on Tue May  7 13:31:56 2019

@author: 70723224
"""

def resale(V, C):

    result = 0
    for v, c in zip(V, C):
        if v > c:
            result += v - c
            
    return result


if __name__ == '__main__':
    

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


    print(resale(v,c))

Solution (Python):
n = int(input())
v = map(int, input().split())
c = map(int, input().split())
b = [x - y for x, y in zip(v, c)]
print(sum(filter(lambda x: x > 0, b)))

Solution (Python):
import numpy as np
 
n = input()
v = np.array([int(x) for x in input().split()])
c = np.array([int(x) for x in input().split()])
 
profit = v - c
positive_profit = profit[profit > 0]
print(np.sum(positive_profit))

Solution (Python):
N = int(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)

Solution (Python):
N = int(input())
vector_list = ([int(x) for x in input().split()])
cost_list = ([int(x) for x in input().split()])
ans = 0
for i in range(len(vector_list)):
  if vector_list[i]-cost_list[i]>0:
    ans += vector_list[i]-cost_list[i]
 
print(ans)

Solution (Python):
N = int(input())
V = [int(x) for x in input().split()]
C = [int(x) for x in input().split()]
diff = [v-c if (v-c > 0) else 0 for v, c in zip(V, C)]
print(sum(diff))

Solution (Python):
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
diff = [v-c if (v-c > 0) else 0 for v, c in zip(V, C)]
print(sum(diff))

Solution (Python):
num = int(input())
value = list(map(int, input().split()))
cost = list(map(int, input().split()))
ans = 0
for i in range(num):
  if value[i] > cost[i]:
    ans = ans + value[i] - cost[i]
 
print(ans)

Solution (Python):
N = int(input())
value = list(map(int, input().split(" ")))
cost = list(map(int, input().split(" ")))

result = 0
for v, c in zip(value, cost):
    if v - c > 0:
        result += v - c
print(result)

Solution (Python):
n = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
ans = 0
for v,c in zip(V,C):
  diff = v-c
  if 0<diff:
    ans += diff
print(ans)

Solution (Python):
n = int(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)

Solution (Python):
n = input()
v = [int(x) for x in input().split()]
c = [int(x) for x in input().split()]
benefit = [val - cost if val-cost>0 else 0 for val, cost in zip(v,c)]
print(sum(benefit))

Solution (Python):





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




import numpy as np




V = np.array(V)
C = np.array(C)




bene = V-C
print(np.sum(bene[bene>0]))

Solution (Python):
N=int(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)

Solution (Python):
N = int(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)

Solution (Python):
ans=0
n=int(input())
v=list(map(int,input().split()))
c=list(map(int,input().split()))
for i in range(n):
    j=v[i]-c[i]
    if j>0:ans+=j
print(ans)

Solution (Python):
N = int(input())
V_list = [int(i) for i in input().split()]
C_list = [int(i) for i in input().split()]

max_point = 0
for i in range(N) :
    p = V_list[i] - C_list[i]
    if (p > 0) :
        max_point += p

print(max_point)

Solution (Python):
n=int(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)

Solution (Python):
n = input()
v = list(map(int, input().split()))
c = list(map(int, input().split()))

x = [0 if vv-cc < 0 else vv-cc for vv,cc in zip(v,c)]
print(sum(x))

Solution (Python):
n = int(input())
vs = map(int, input().split(" "))
cs = map(int, input().split(" "))

print(sum(filter(lambda i: i > 0, map(lambda i: i[0] - i[1],zip(vs, cs)))))

Solution (Python):
from operator import sub
res = 0
n = int(input())
list1 = map(int,input().split())
list2 = map(int,input().split())
list3 = map(sub , list1,list2)
for i in list3:
    if i > 0:
        res = res + i
print(res)

Solution (Python):

n = int(input())
vl = list(map(int, input().split()))
cl = list(map(int, input().split()))

res = -1

for i in range(2**n):
    x = 0
    y = 0
    for j in range(n):
        if i>>j&1==1:
            x += vl[j]
            y += cl[j]
    res = max(res, x-y)

print(res)

Solution (Python):
N = int(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)

Solution (Python):
N = int(input())
V = [int(_) for _ in input().split()]
C = [int(_) for _ in input().split()]

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

print(a)

Solution (Python):

import numpy as np

N=int(input())
Vi=np.array(input().split(),dtype=int)
Ci=np.array(input().split(),dtype=int)

Xi=Vi-Ci
Xi_sort=np.sort(Xi)[::-1]
num=np.sum(Xi_sort>=0)

if num == 0:
    XY_max=0
else :
    XY_max=np.sum(Xi_sort[0:num])

print(XY_max)

Solution (Python):
N=int(input())
V = map(int,input().split())
C = map(int,input().split())
z = [x-y for(x,y) in zip(V,C)]
sum=0
for zz in z:
    if zz > 0:
        sum=sum+zz   
print(sum)

Solution (Python):
N=int(input())
V=[]
V=list(map(int,input().split(" ",N)))
C=[]
C=list(map(int,input().split(" ",N)))
max=0
for i in range(len(V)):
    if V[i]-C[i]>0:
        max+=V[i]-C[i]

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

Solution (Python):
N = int(input())

value = input().rstrip().split(' ')
cost  = input().rstrip().split(' ')

X = 0
Y = 0

for i in range(N):

    if int(value[i]) > int(cost[i]):
        X += int(value[i])
        Y += int(cost[i])
    else:
        pass


print(X-Y)

Solution (Python):
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))

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

print(out)

Solution (Python):
N = int(input())
vlist = list(map(int, input().split()))
clist = list(map(int, input().split()))
ans=0
for i in range(N):
    if vlist[i] - clist[i] > 0:
        ans += vlist[i] - clist[i]
print(ans)

Solution (Python):
N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))
sum = 0
for i in range(N):
    a = V[i]-C[i]
    if a > 0:
        sum += a

print(sum)

Solution (Python):
N = int(input())
vlist = list(map(int, input().split()))
clist = list(map(int, input().split()))

cnt = 0
for i in range(N):
  diff = vlist[i]-clist[i]
  if diff > 0:
    cnt += diff
    
print(cnt)

Solution (Python):
n=int(input())
v=list(map(int,input().split()))
c=list(map(int,input().split()))

get=[]
for i in range(len(v)):
    if v[i]-c[i]>=0:
        get.append(v[i]-c[i])

print(sum(get))

Solution (Python):
n = int(input())
v = list(map(int,input().split()))
c = list(map(int,input().split()))

answer = 0

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

print(answer)

Solution (Python):
N=int(input())
list1=list(map(int,input().split()))
list2=list(map(int,input().split()))
ans=0
for i in range(N):
    if list1[i]>list2[i]:
        ans+=(list1[i]-list2[i])
print(ans)

Solution (Python):
import importlib
import_module = lambda name:importlib.import_module(name)

input = import_module('sys').stdin.readline
input_int = lambda:int(input())
input_ints = lambda:map(int,input().split())
input_ints_list = lambda:list(input_ints())
input_str = lambda:input()
input_strs = lambda:input().split()
input_lines = lambda n,f:[f() for _ in range(n)]

gcd_base = lambda a,b:import_module('fractions').gcd(a,b) 
gcd = lambda a:import_module('functools').reduce(gcd_base,a) 
lcm_base = lambda a,b:(a*b)//import_module('fractions').gcd(a,b) 
lcm = lambda a:import_module('functools').reduce(lcm_base,a,1) 

permutations = lambda a,n:import_module('itertools').permutations(a,n) 
combinations = lambda a,n:import_module('itertools').combinations(a,n) 
product = lambda a,b:import_module('itertools').product(a,b) 

init_array_1dim = lambda v,n:[v]*n
init_array_2dim = lambda v,n,m:[init_array_1dim for _ in range(m)]


ceil = lambda a:import_module('math').ceil(a) 
floor = lambda a:import_module('math').floor(a) 


convert_list_to_queue = lambda a:import_module('collections').deque(a)
pop_q = lambda a:a.popleft()
push_q = lambda a,e:a.appendleft(e)
push_q_list = lambda a,l:a.extendleft(l) 


def init_head(a):import_module('heapq').heapify(a)
def heap_push(a,v):import_module('heapq').heappush(a,v)
heap_pop = lambda a:import_module('heapq').heappop(a) 


bisect_left = lambda a,x:import_module('bisect').bisect_left(a,x)
bisect_right = lambda a,x:import_module('bisect').bisect_left(a,x)
insert_left = lambda a,x:import_module('bisect').insert_left(a,bisect_left(a,x))
insert_right = lambda a,x:import_module('bisect').insert_right(a,bisect_right(a,x))


cumsum = lambda a:import_module('numpy').cumsum(import_module('numpy').array(a)) 
cumprod = lambda a:import_module('numpy').cumprod(import_module('numpy').array(a)) 
cumgcd = lambda a:import_module('numpy').frompyfunc(gcd, 2, 1).accumulate(a, dtype=import_module('numpy').object).astype(import_module('numpy').int) 

class UnionFind(object):
    def __init__(self, n):
        self.par = [i for i in range(n)]
        self.rank = [0 for _ in range(n)]
        self.size = [1 for _ in range(n)]

    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x != y:
            if self.rank[x] < self.rank[y]:
                x, y = y, x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1
            self.par[y] = x
            self.size[x] += self.size[y]

    def is_same(self, x, y):
        return self.find(x) == self.find(y)

    def get_size(self, x):
        x = self.find(x)
        return self.size[x]


def dfs_graph(v,n,graph,visited):
    if all(visited):return 1 
    ans = 0
    for i in range(n):
        if not graph[v][i]:continue 
        if visited[i]:continue 
        visited[i] = True
        ans += dfs_graph(i,n,graph,visited)
        visited[i] = False
    return ans


def warshall_floyd(n,graph):
    d = init_array_2dim(float("inf"),n,n)
    
    for i in range(n):
        d[i][i] = 0
        for j in range(n):
            if graph[i][j]:d[i][j] = 1
    
    for k in range(n):
        for i in range(n):
            for j in range(n):
                d[i][j] = min(d[i][j],d[i][k] + d[k][j])
    return d


def init_graph(n,a,directed=False):
    visited = init_array_1dim(False,n)
    graph = init_array_2dim(False,n,n)
    for e in a:
        graph[e[0]-1][e[1]-1] = True
        if not directed:graph[e[1]-1][e[0]-1] = True 
    return visited,graph

def two_pointers(s,threshold,ope='sum'):
    l,r = 0,0
    base = 0 
    if ope == 'sum':base = 0
    if ope == 'prd':base = 1
    diff = 0
    while r < len(s):
        val = 0
        if ope == 'sum':val = base+s[r]
        if ope == 'prd':val = base*s[r]
        if val <= threshold:
            if ope == 'sum':base += s[r]
            if ope == 'prd':base *= s[r]
            diff = max(diff, r-l+1)
            r += 1
        elif l == r:
            r += 1
            l += 1
        else:
            if ope == 'sum':base -= s[l]
            if ope == 'prd':base //= s[l]
            l += 1
    return diff

def solution():
    
    global N,V,C
    N = input_int()
    V = input_ints_list()
    C = input_ints_list()

    vals = [x-y for x,y in zip(V,C) if x-y > 0]
    print(sum(vals))
        
	
if __name__ == '__main__':
    solution()

Solution (Python):
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
r = 0
for i in range(n):
    if v[i] - c[i] > 0:
        r += v[i] - c[i]
print(r)

Solution (Python):
n = int(input())
v_tuple = tuple(map(int, input().split()))
c_tuple = tuple(map(int, input().split()))
diff_vc = (v_tuple[i] - c_tuple[i] for i in range(n))
print(sum([x for x in diff_vc if x > 0]))

Solution (Python):
N=int(input())
vl=input().split()
cl=input().split()
pl = 0
for i in range(N):
    if int(vl[i]) > int(cl[i]):
        pl += int(vl[i]) - int(cl[i])
print(pl)

Solution (Python):
N = int(input())
value = [int(i) for i in input().split(" ")]
cost = [int(i) for i in input().split(" ")]
total = 0
for i in range(N):
  if (value[i] - cost[i]) > 0:
    total += (value[i] - cost[i])

print(total)

Solution (Python):
N = int(input())
value = [int(i) for i in input().split(" ")]
cost = [int(i) for i in input().split(" ")]
total = 0
for i in range(N):
  if (value[i] - cost[i]) > 0:
    total += (value[i] - cost[i])

print(total)

Solution (Python):
N = int(input())
value = [int(i) for i in input().split(" ")]
cost = [int(i) for i in input().split(" ")]
total = 0
for i in range(N):
  if (value[i] - cost[i]) > 0:
    total += (value[i] - cost[i])

print(total)

Solution (Python):
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
tv = []
ans = 0
for i in range(n):
    tv.append(v[i] - c[i])
tv.sort()
tv = reversed(tv)
for i in tv:
    if i > 0:
        ans += i
print(ans)

Solution (Python):
N = int(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)

Solution (Python):
def calc_max_total_jewels_value():
  jewels = int(input())
  jewel_value = [int(x) for x in input().split()]
  jewel_cost = [int(x) for x in input().split()]
  
  max_total_jewels_value = 0
  for jewel_no in range(jewels):
    max_total_jewels_value += max([0, jewel_value[jewel_no] - jewel_cost[jewel_no]])
    
  return max_total_jewels_value

if __name__ == '__main__':
  print(calc_max_total_jewels_value())

Solution (Python):
n=int(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)

Solution (Python):
N = int(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)

Solution (Python):
N=int(input())
v=list(map(int,input().split()))
c=list(map(int,input().split()))
d=[]
for i in range(N):
  m=v[i]-c[i]
  if m>0:
    d.append(m)
print(sum(d))

Solution (Python):
n = int(input())
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
s = 0
for i in range(n):
    if a[i]-b[i] > 0:
        s += a[i]-b[i]
print(s)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = 0
for i in range(n):
	if a[i] > b[i]:
		ans += a[i]-b[i]
print(ans)

Solution (Python):
n = int(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 > 0:
        ans += v - c

print(ans)

Solution (Python):
def main():
  size = int(input())
  value = list(map(int, input().split()))
  cost = list(map(int, input().split()))
  diff = [value[i]-cost[i] for i in range(len(value))]
  diff.sort(reverse=True)
              
  sum = 0
  for i in range(len(value)):
    if diff[i] > 0:
      sum += diff[i]
    else: 
      break
        
  print(sum)

main()

Solution (Python):
N = int(input())
V = [int(j) for j in input().split()]
C = [int(j) for j in input().split()]
mxX = 0
for j in range(0,N):
	if V[j] > C[j]:
		mxX = mxX + V[j] - C[j]
print(mxX)

Solution (Python):
N = int(input())
V = list(map(int, input().split(" ")))
C = list(map(int, input().split(" ")))

ans = 0

for i in range(N):

    value = V[i] - C[i]

    if(value > 0):
        ans += value

print(ans)

Solution (Python):
N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))
P = [v-c for v,c in zip(V,C) if v-c > 0]
print(sum(P))

Solution (Python):
n = int(input())
gem_value = list(map(int, input().split(' ')))
gem_cost = list(map(int, input().split(' ')))
max_value = 0

for i in range(n):
  if gem_value[i] > gem_cost[i]:
    max_value += gem_value[i] - gem_cost[i]

print(max_value)

Solution (Python):
n = int(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)

Solution (Python):
N = int(input())
goukei=0

Vn=input().rstrip().split(" ")
Cn = input().rstrip().split(" ")

for i in range(N):
  dif = int(Vn[i]) - int(Cn[i])
  if dif > 0:
    goukei += dif
print(goukei)

Solution (Python):
N = int(input())
Value_list = [int(x) for x in input().split()]
Cost_list = [int(x) for x in input().split()]
diff_sum = 0

for i in range(N):
    
    difference = Value_list[i] - Cost_list[i]
    
    if difference < 0:
        pass
    else:
        diff_sum += difference

print(diff_sum)

Solution (Python):

n = int(input())

v = input().split()
c = input().split()
sum=0

for i in range(0,n):
    s = int(v[i])-int(c[i]) 
    if s >=0:
        sum += s
print(sum)