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()))
print(sum(max(0, v - c) for v, c in zip(v, c)))

Solution (Python):
n = int(input())
vs = list(map(int, input().split(' ')))
cs = list(map(int, input().split(' ')))
print(sum([v-c for v, c in zip(vs, cs) if v > c]))

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

dp = [[0]*(n+1) for _ in range(n+1)]

for i in range(n+1):
    for j in range(n):
        dp[i][j+1] = dp[i][j]
        dp[i][j+1] = max(dp[i][j], dp[i][j]+v[j]-c[j])

print(dp[n][n])

Solution (Python):
from itertools import combinations
n=int(input())
v=list(map(int, input().split()))
c=list(map(int, input().split()))
v_c=[v[i]-c[i] for i in range(n)]

x_y=0
for i in range(n):
	if v_c[i]>=0:
		x_y+=v_c[i]

print(x_y)

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

x = []
for i in range(n):
    if v[i] - c[i] > 0:
        x.append(v[i] - c[i])
print(sum(x))

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

V_list = list(map(int, input().split()))
C_list = list(map(int, input().split()))

cnt = 0
for i in range(N):
  cnt += max(0, V_list[i]-C_list[i])
  
print(cnt)

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

gain = [0]*n

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


print(sum(gain))

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

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

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

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 = [int(x) for x in input().split()]
c = [y - int(x) for x, y in zip(input().split(), v)]

p = 0
for i in range(n):
   if (c[i] > 0):
      p += c[i]
print(p)

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

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

ans = 0
for vv,cc in zip(v,c):
  if vv - cc > 0:
    ans += vv-cc
print(ans)

Solution (Python):
"""
author : halo2halo
date : 12, Jan, 2020
"""

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N = int(readline())
V = map(int, readline().split())
C = map(int, readline().split())
ans = 0
for v, c in zip(V, C):
    if v - c > 0:
        ans += v - c

print(ans)

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):
  ans += (v[i]-c[i] if v[i] > c[i] else 0)
print(ans)

Solution (Python):
def main():
    N = int(input())
    V = list(map(int, input().split(" ")))
    C = list(map(int, input().split(" ")))
    L = []
    for v, c in zip(V, C):
        L.append(max(v - c, 0))
    print(sum(L))


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
ans = 0
for vi,ci in zip(v,c):
    x = vi-ci
    if x>0:
        ans += x
print(ans)

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

val=0

for i in range(n):
    dif=vl[i]-cl[i]
    if dif>=0:
        val+=dif
print(val)

Solution (Python):

 
import math
import itertools
import sys
import copy
 






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] > 0 :
    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
X = 0
Y = 0
for i in range(N):
  if ans < (X + V[i]) - (Y + C[i]):
      X += V[i]
      Y += C[i]
      ans = X - Y

print(ans)

Solution (Python):
n=int(input())
v=list(map(int,input().split()))
c=list(map(int,input().split()))
ans=[]
sum_v=0
sum_c=0
for i in range(n):
	if v[i]-c[i]>=0:
		sum_v+=v[i]
		sum_c+=c[i]
		ans.append(sum_v-sum_c)
try:
	print(max(ans))
except ValueError:
	print("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):
  ans+=max(V[i]-C[i],0)
print(ans)

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

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]
    else:
        ans = ans

print(ans)

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()))
sum = 0
for i in range(n):
  if v[i] > c[i]:
    sum += v[i] - c[i]
print(sum)

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

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

ans = 0
for v, c in zip(values, costs):
    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()))
ans = 0
for i in range(N):
    val = V[i]-C[i]
    if val>0:
        ans+=val
print(ans)

Solution (Python):
N, *V = map(int, open(0).read().split())
s = 0
for i in range(N):
    v = V[i]
    c = V[i+N]
    s += (v - c if v - c > 0 else 0)

print(s)

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

res = 0

for i in range(n):
    if v[i] - c[i] >= 0:
        res += v[i] - c[i]
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] > 0:
    ans += V[i] - C[i]

print(ans)

Solution (Python):
N = int(input())
values = list(map(int, input().split()))
costs =list(map(int, input().split()))

max_value = 0

for i in range(N):
    diff = values[i] - costs[i]
    if diff > 0:
        max_value += diff

print(max_value)

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

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

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

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

Solution (Python):
n = int(input())
v = list(map(int,input().split()))
c = list(map(int,input().split()))
print(sum([max(0,vv-cc) for vv, cc in zip(v,c)]))

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

sumX = 0
sumC = 0

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

print(sumX - sumC)

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

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

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())))


res = sum([max(0, v - c) for v, c in zip(V, C)])


print(res)

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

ans = 0
for x,y in zip(v,c):
    ans += max(0,x-y)
print(ans)

Solution (Python):
n = int(input())
vi = list(map(int, input().split()))
ci = list(map(int, input().split()))

prof = 0

for i in range(n):
    if vi[i] - ci[i] > 0:
        prof += vi[i] - ci[i]

print(prof)

Solution (Python):
n=int(input())
v_list=list(map(int,input().split()))
c_list=list(map(int,input().split()))

diff_list = [v_list[i]-c_list[i] for i in range(n) if v_list[i] - c_list[i] > 0]
diff_list.append(0)
print(sum(diff_list))

Solution (Python):
N = int(input())
V_list = list(map(int,input().split()))
C_list = list(map(int,input().split()))
value_list = [x-y for (x,y) in zip(V_list,C_list)]

ans = 0
for i in value_list:
    if i>0:
        ans += i

print(ans)

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

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()))

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

print(a)

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

A = list(map(int, input().split()))
B = list(map(int, input().split()))

total = 0
for i in range(n):
    if A[i] - B[i] > 0:
        total += A[i] - B[i]
print(total)

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

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

for i in range(N):
    A.append(V[i] - C[i])
tmp = 0
for v in A:
    if v > 0:
        tmp += v
print(tmp)

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

sum = 0
for n in range(N):
  if V[n] > C[n]:
    sum += V[n] - C[n]
    
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):
    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()))
for i in range(N):
	V[i] = V[i] - C[i]
V = sorted(V)
ans = 0
for i in range(N):
	if(V[-i]>0):
		ans += V[-i]
print(ans)

Solution (Python):
N = int(input())
V = str(input())
C = str(input())
V = V.split()
C = C.split()
V_list = []
C_list = []
diff_list = []
for i in range(N):
    V_list.append(int(V[i]))
    C_list.append(int(C[i]))
for i in range(N):
    diff_list.append(V_list[i] - C_list[i])

diff_list.sort()
diff_list.reverse()
result = 0
for i in range(N):
    if diff_list[i] >= 0:
        result = result + diff_list[i]
    else:
        break

print(result)

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

cal = []
for i in range(0,n):
    cal.append(v[i]-c[i])
cal.sort(reverse=True)
ans = 0
for j in range(0,n):
    if cal[j] < 0:
        break
    ans += cal[j]
print(ans)

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

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

Solution (Python):
n = int(input())
v = list(input().split())
c = list(input().split())
tmp = 0

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

print(tmp)

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):
    tmp = v[i] - c[i]
    if tmp > 0:
        ans += tmp
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):
n=int(input())
v=[int(i) for i in input().split()]
c=[int(i) for i in input().split()]
sum=0
for i in range(n):
  if v[i]>c[i]:
    sum+=v[i]-c[i]
print(sum)

Solution (Python):
from functools import reduce
from operator import add
n=int(input())
v=[int(i) for i in input().split()]
c=[int(i) for i in input().split()]
l=[v[i]-c[i] for i in range(n) if v[i]>c[i]]
print(reduce(add,l) if l else 0)

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):
  if v[i]>c[i]:
    dif.append(v[i]-c[i])
print(sum(dif))

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

Solution (Python):

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

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

ans = 0
for item in VminusC:
    if item > 0:
        ans += item
        
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):
N = int(input())
V = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]

ans = 0
for v, c in zip(V, C):
    ans += max(v - c, 0)

print(ans)

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

Solution (Python):
N, *L,  = [list(map(int, s.split())) for s in open(0)]
N = N[0]
value = 0
for i in range(N):
    if L[0][i] > L[1][i]:
        value += L[0][i] - L[1][i]
print(value)

Solution (Python):
def solve():
    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)


if __name__ == '__main__':
    solve()

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

ans = []
for j in range(n):
    if V[j] >= C[j]:
        ans.append(V[j]-C[j])
        
print(sum(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):
import itertools

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

ans = 0
Vsum = []
Csum = []
for i in range(1,N+1):
  Vsum.append(list(itertools.combinations(V, i)))
  Csum.append(list(itertools.combinations(C, i)))

for i in range(N):
  for j in range(len(Vsum[i])):
    if ans <= sum(Vsum[i][j]) - sum(Csum[i][j]):
      ans = sum(Vsum[i][j]) - sum(Csum[i][j])

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):
    gain = v[i] - c[i]
    if gain > 0:
        ans += gain

print(ans)

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

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=[int(x) for x in input().split()]
C=[int(x) for x in input().split()]

buf=[]
result=0

for i in range(N):
    buf.append(V[i]-C[i])

for b in buf:
    if b>0:
        result+=b

print(result)

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

Solution (Python):
n = int(input())
v = input().split()
c = input().split()
d = 0

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

Solution (Python):

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

ans = 0
for i in range(N):
    Z = Vlist[i] - Clist[i]
    if Z > 0:
        ans += Z

print(ans)

Solution (Python):

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


D = [v-c for v, c in zip(V, C) if v-c >0]

print(sum(D))

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

print(ans)

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

print(sum(k))

Solution (Python):
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
print(sum([max(A[i]-B[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):
  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()))
ans1=0
ans2=0
for i in range (len(v)):
    if v[i]>c[i]:
        ans1 += v[i]-c[i]
print(ans1)

Solution (Python):
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
l = []
for i in range(n):
    if v[i]/c[i] > 1:
        l.append(i)
if l:
    vt,ct=0,0
    for j in l:
        vt += v[j]
        ct += c[j]
    print(vt-ct)
else:print(0)

Solution (Python):
N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))
diff = []
for i in range(N):
    diff.append(V[i]-C[i])

diff2 = [i for i in diff if i >0]
print(sum(diff2))

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())
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))

Solution (Python):

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

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 = 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 = ans + ((V[i]) - (C[i]))

print(ans)

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

dif = [0] * n

for i in range(n):
  dif[i] = v[i] - c[i]

for j in range(n):
  if dif[j] < 0:
    dif[j] = 0

print(sum(dif))

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

v_c = [x-y for (x, y) in zip(v, c) if x-y > 0]
print(sum(v_c))

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

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

print(ans)

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

ans = 0
for _v, _c in zip(v, c):
    vc = _v - _c
    if 0 <= vc:
        ans += vc

print(ans)

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

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

print(buf)

Solution (Python):
def main():
    N = int(input())
    V = [int(i) for i in input().split()]
    C = [int(i) for i in input().split()]
    ans = 0
    for v, c in zip(V, C):
        if v - c > 0:
            ans += v - c
    print(ans)


if __name__ == '__main__':
    main()

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

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

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

print(ans)

Solution (Python):
n=int(input())
v=list(map(int,input().split()))
c=list(map(int,input().split()))
a=[]
for i in range(n):
    x=v[i]
    y=c[i]
    a.append(x-y)

def max_sum(N,a):
  dp=[0]*(N+1)
  for i in range(N):
    dp[i+1]=max(dp[i],dp[i]+a[i])
  return dp[N]

print(max_sum(n,a))

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()))
nums=[x for x in range(n)]
ans=0
for num in nums:
  k=v[num]-c[num]
  if(k>0):
    ans+=k
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):
n=int(input())
vl=list(map(int,input().split()))
cl=list(map(int,input().split()))
ans=0
for i in range(n):
  if vl[i]-cl[i]>0:
    ans+=vl[i]-cl[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):
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):
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())
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()))
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)

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())
X, Y = 0, 0
V = list(map(int, input().split()))
C = list(map(int, input().split()))

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 = list(map(int,input().split()))
c = list(map(int,input().split()))
ans = 0
for i in range(n):
  c[i] = v[i] - c[i]
  if(c[i] < 0):
    c[i] = 0
  ans += c[i]

print(ans)

Solution (Python):
n = int(input())
value = list(map(int, input().split()))
cost = list(map(int, input().split()))
true_value = []

for i in range(n):
    t = value[i]-cost[i]
    true_value.append(t)

true_value_a = [i for i in true_value if i >  0]

print(sum(true_value_a))

Solution (Python):
import sys
input = sys.stdin.readline
import numpy as np
def print_ans(N, vs, cs):
    """Test Case
    >>> print_ans(3, [10, 2, 5], [6, 3, 4])
    5
    >>> print_ans(4,[13, 21, 6, 19], [11, 30, 6, 15])
    6
    >>> print_ans(1,[1],[50])
    0
    """
    vs = np.array(vs)
    cs = np.array(cs)
    tmps = vs - cs
    ans_list = tmps[tmps > 0]
    if len(ans_list) == 0:
        print("0")
    else:
        print(np.sum(ans_list))
if __name__ == '__main__':
    N = int(input().rstrip())
    vs = list(map(int, input().rstrip().split()))
    cs = list(map(int, input().rstrip().split()))
    print_ans(N, vs, cs)

Solution (Python):
n = int(input())
ls_v = list(map(int, input().split()))
ls_c = list(map(int, input().split()))

x = 0
y = 0

for i in range(n):
    if ls_v[i] - ls_c[i] >= 0:
        x += ls_v[i]
        y += ls_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):
  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()))
summary=0

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

print(summary)

Solution (Python):

import sys, math, itertools, heapq, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
sys.setrecursionlimit(10**8)
inf = float('inf')
ans = count = 0

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

Solution (Python):
def p_b():
    n = int(input())
    *v, = map(int, input().split())
    *c, = map(int, input().split())
    ans = 0
    for a, b in zip(v, c):
        if a - b > 0:
            ans += a - b
    print(ans)
    
p_b()

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] > 0:
        Sum = Sum + v[i] -c[i]

print(Sum)

Solution (Python):
def examB():
    N = I()
    V = LI(); C = LI()
    ans = 0
    for i in range(N):
        cur = V[i]-C[i]
        if cur>0:
            ans += cur
    print(ans)
import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examB()

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

list_V_C =[]

for i in range(N):
    list_V_C.append(list_v[i]-list_c[i])

aaa_max =0
for i in list_V_C:
    aaa_max += max(0,i)

print(aaa_max)

Solution (Python):
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
D = [V[i] - C[i] for i in range(N)]
F = [d for d in D if d > 0]
if len(F) == 0:
  print(0)
else:
  print(sum(F))

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(' '))))
tmp=V-C
tmp=map(lambda x: max(0,x),tmp)
print(sum(tmp))

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

    
    D = [V[i] - C[i] for i in range(N)]
    
    F = [d for d in D if d > 0]

    if len(F) == 0:
        print(0)
    else:
        print(sum(F))

if __name__ == "__main__":
    main()

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

tmp = [v[i]-c[i] if v[i]>c[i] else 0 for i in range(n)]

ret=sum(tmp)

print(ret)

Solution (Python):

n = int(input())
v = [int(s) for s in input().split()]
c = [int(s) for s in input().split()]
subtract_c_from_v = [v[i] - c[i] for i in range(n)]

maximum = 0

for subtraction in subtract_c_from_v:
    if subtraction > 0:
        maximum += subtraction

print(maximum)

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 (c[i] <= v[i]):
        ans += (v[i] - c[i])

print(ans)

Solution (Python):
n = int(input())
vn = list(map(int, input().split()))
cn = list(map(int, input().split()))


ans = 0
for i in range(n):
    if vn[i] - cn[i] > 0:
        ans += vn[i] - cn[i]
print(ans)

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

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

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

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

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]
    else:
        continue
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 = int(input())
V = list(map(int , input().split()))
C = list(map(int , input().split()))

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

print(X_Y)

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

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

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

Solution (Python):
def inpl():
    return list(map(int, input().split()))


def gcd(a, b):
    
    while b > 0:
        a, b = b, a % b

    return a


N = int(input())
V = inpl()
C = inpl()

print(sum(V[i] - C[i] for i in range(N) if V[i] > C[i]))

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()))

a = []
for i in range(N):
  if v[i] > c[i]:
    a.append(v[i] -c[i])
print(sum(a))