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()))
L=[max(v[i]-c[i],0) for i in range(N)]
print(sum(L))

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

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

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()))
ans=0
for i,j in zip(v,c):
  if i-j>0:
    ans+=i-j
print(ans)

Solution (Python):
def sub():
    N, Vs, Cs = [input() for _ in range(3)]
    N = int(N)
    Vs = [int(e) for e in Vs.split(" ")]
    Cs = [int(e) for e in Cs.split(" ")]
    ds = [v - c for v, c in zip(Vs, Cs)]
    ds = [d for d in ds if d > 0]
    print(sum(ds))


sub()

Solution (Python):
N=int(input())
Vs=str(input())
Cs=str(input())
ListV=Vs.split()
ListC=Cs.split()
for i in range(0,len(ListV),1):
  a=ListV.pop(0)
  ListV.append(int(a))

for i in range(0,len(ListC),1):
  b=ListC.pop(0)
  ListC.append(int(b))

ListI=[]
for i in range(0,len(ListV),1):
  c=ListV[i]-ListC[i]
  ListI.append(c)

Ans=0
for i in range(0,len(ListI),1):
  if ListI[i]>0:
    Ans+=ListI[i]

print(Ans)

Solution (Python):

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

    print(algorithm(N, V, C))


def algorithm(N, V, C):
    indices = list(filter(lambda i: V[i] - C[i] > 0, list(range(0, N))))

    sum = 0
    for i in indices:
        sum += V[i] - C[i]
    return sum

problem()

Solution (Python):

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

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

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=[int(i) for i in input().split()]
C=[int(i) for i in input().split()]
profits = 0
for i in range(N):
  profit = V[i]-C[i]
  if profit > 0:
    profits = profits + profit
print(profits)

Solution (Python):
N = 0
V = []
C = []
 
i = 0
ans = 0

str = input()
N = int(str)
 
str = input().split()
while i < N:
  V.append(int(str[i]))
  i = i+1
  
i=0
str = 0
str = input().split()
while i < N:
  C.append(int(str[i]))
  i = i+1

i=0
while i<N:
  if V[i] > C[i]:
    ans = ans + V[i] - C[i]
  i = i+1
    
    
print(ans)

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

print(count)

Solution (Python):
n = input()

v = input()
v = v.split(' ')
v = [int(a) for a in v]

c = input()
c = c.split(' ')
c = [int(a) for a in c]

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

print(r)

Solution (Python):
n = int(input())
values = [ int(x) for x in input().split() ]
cost = [ int(x) for x in input().split() ]
profit_list = [ values[i] - cost[i] for i in range(n) if values[i] > cost[i] ]
print(sum(profit_list))

Solution (Python):
N=int(input())
V = [int(x) for x in input().split()]
C = [int(x) for x in input().split()]
point = 0
for n in range(N):
    temp = V[n] - C[n]
    if temp > 0:
        point+=temp

print(point)

Solution (Python):
import itertools

n = int(input())

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

cost = [v-c for v,c in zip(V,C)]

max_cost = 0

for i in range(1,n+1):
    for v in itertools.combinations(cost,i):
        m_cost = 0
        for c in v:
            m_cost = m_cost + c
        if max_cost < m_cost:
            max_cost = m_cost


print(max_cost)

Solution (Python):
n = int(input())
vList = list(map(int, input().split()))
cList = list(map(int, input().split()))





vSum = 0
cSum = 0

for i in range(n):
	if vList[i] > cList[i]:
		vSum += vList[i]
		cSum += cList[i]

print(vSum - cSum)

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

Solution (Python):
import numpy as np

n = int(input())
v = np.array(list(map(int, input().split())))
vc = v - np.array(list(map(int, input().split())))

print(vc[vc>0].sum())

Solution (Python):
N=int(input())
V=list(map(int,input().split()))
C=list(map(int,input().split()))
def rescale(V,C):
  price=0
  for v,c in zip(V,C):
    if v>c:
      price=price+v-c
  return price 
print("{}".format(rescale(V,C)))

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

V = [int(x) for x in input().split()]

C = [int(x) for x in input().split()]

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

Solution (Python):
inputCount = int(input())
inputValue = list(map(int, input().split()))
inputCost  = list(map(int, input().split()))
answer = 0

for num in range(0,inputCount):
    stock = inputValue[num] - inputCost[num]
    if stock > 0:
        answer += stock

print(answer)

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

est = 0

for a in range(n) :
    x = v[a] - c[a]
    if x > 0 :
        est += x

print(est)

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

Solution (Python):

import sys


def solve(N: int, V: "List[int]", C: "List[int]"):

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

    print(total)



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    V = [ int(next(tokens)) for _ in range(N) ]  
    C = [ int(next(tokens)) for _ in range(N) ]  
    solve(N, V, C)

if __name__ == '__main__':
    main()

Solution (Python):
import heapq

n = input()
v = input()
v = v.split()
c = input()
c = c.split()

VSubC = []

for index in range(int(n)):
  heapq.heappush(VSubC, -(int(v[index]) - int(c[index])))

answer = 0
while(len(VSubC) > 0):
  item = heapq.heappop(VSubC)
  if (item < 0):
    answer -= item
  else:
    break

print(answer)

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

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(vs[i]-cs[i],0)
print(ans)

Solution (Python):
N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))
sum = 0
for v,c in zip(V,C):
  if (v-c)>0:
    sum+=v-c
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()))

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()))
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]*N
for i in range(len(V)):
    for j in range(len(C)):
        A[i]=V[i]-C[i]
n=0
for i in range(len(A)):
    if A[i]>=0:
        n+=A[i]
print(n)

Solution (Python):
N = input()

vs = [int(x) for x in input().split()]
cs = [int(x) for x in input().split()]

m = sum([v-c for v,c in zip(vs,cs) if v-c > 0])
print(m)

Solution (Python):
def Resale():
	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]]
	
	print(sum(XY))
Resale()

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

Z = V - C
Ans = 0
for i in range (N):
    if Z[i]>0:
        Ans += Z[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 i in range(N):
  if V[i] >= C[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):
    ans += max(0, VN[i] - CN[i])
print(ans)

Solution (Python):
import sys

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def II(): return int(sys.stdin.readline())

N = II()
V_li = LI()
C_li = LI()

result = 0
for v, c in zip(V_li, C_li):
    if v-c > 0:
        result += v-c

print(result)

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

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

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

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

for i in range(N):
    if V[i] <= C[i]:
        continue
    X,Y = V[i],C[i]
    tmpMax = X - Y
    for j in range(i+1,N):
        if V[j] <= C[j]:
            continue
        if Max < (X + V[j]) - (Y + C[j]):
            X = X + V[j]
            Y = Y + C[j]
            tmpMax = X - Y
    if Max < tmpMax:
        Max = tmpMax
        
print(Max)

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


for i in range(N):
    if V[i] <= C[i]:
        continue
    X,Y = V[i],C[i]
    tmpMax = X - Y
    for j in range(i+1,N):
        if V[j] <= C[j]:
            continue
        if Max < (X + V[j]) - (Y + C[j]):
            X = X + V[j]
            Y = Y + C[j]
            tmpMax = X - Y
    if Max < tmpMax:
        Max = tmpMax
        
print(Max)

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

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

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

Solution (Python):



jewel_count = int(input())


jewels_value = input().split()


jewels_cost = input().split()


max_value = 0


for i in range(jewel_count):
    
    difference_num = int(jewels_value[i]) - int(jewels_cost[i])

    
    if (difference_num > 0):
        max_value += difference_num

print(max_value)

Solution (Python):
import sys

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(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())
a=b=count=0

a=list(map(int, input().split()))
b=list(map(int, input().split()))

for i in range(N):
    if a[i]-b[i]>0:
        count=count+(a[i]-b[i])
print(count)

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

s = []
for i, j in zip(v, p):
    if i - j > 0:
        s.append(i-j)

print(sum(s))

Solution (Python):
n=int(input())
a=[int(i) for i in input().split()]
b=[int(i) for i 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())
v = list(map(int,input().split(" ")))
c = list(map(int,input().split(" ")))


i = 0
total = 0

while i < n:
    if v[i] > c[i]:
        total = total + (v[i]-c[i])
    i = i + 1
print(total)

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

a = []

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

Solution (Python):
N = int(input())
list_V = list(map(int, input().split()))
list_C = list(map(int, input().split()))
ans = 0
for i in range(N):
    currentValue = list_V[i] - list_C[i] 
    if currentValue > 0: 
        ans += currentValue 
print(int(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 = list(input().split())
C = list(input().split())
D = 0
for i in range(N):
    A = int(V[i])-int(C[i])
    if A>0:
        D += A
print(D)

Solution (Python):
n=int(input())
v=list(map(int, input().split()))
c=list(map(int, input().split()))
vc=[(v[i],c[i]) for i in range(n)]
vc=sorted(vc,key=lambda x:(x[0],x[1]))[::-1]
x=0
y=0
ans=0
for i in range(n):
    temp_x = x+vc[i][0]
    temp_y = y+vc[i][1]
    if ans<temp_x-temp_y:
        ans=temp_x-temp_y
        x+=vc[i][0]
        y+=vc[i][1]
print(ans)

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

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

Solution (Python):
n = int(input())
v = list(int(x) for x in input().split())
c = list(int(x) for x in input().split())
max = 0

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

print(max)

Solution (Python):
a= int(input())
b = list(map(int, input().split()))
c = list(map(int,input().split()))

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

print(answer)

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

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

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

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

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

V=map(int,raw_input().split())
C=map(int,raw_input().split())

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

print count

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] > 0:
    answer += V[i] - C[i]
print(int(answer))

Solution (Python):




N = int(input())
V = [int(v) for v in input().split(' ')]
C = [int(v) for v in input().split(' ')]





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


print(int(sum(prof)))

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

if __name__ == '__main__':
    main()

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

Solution (Python):
N=input()
list1= [int(i) for i in input().split()]
list2 = [int(i) for i in input().split()]
list3= [x - y for (x, y) in zip(list1, list2)]
replace= [0 if i < 0 else i for i in list3]
print(sum(replace))

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

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

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

ans = 0

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

print(ans)

Solution (Python):
n=int(input())
vc=[]
ans=0

for i,j in zip(input().split(),input().split()):
    vc.append([int(i),int(j)])

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

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())
hoge=list(map(int,input().split()))
huga=list(map(int,input().split()))
ans=0
for i in range(n):
  ans+=max(0,hoge[i]-huga[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):
N=int(input())
V=list(map(int,input().split()))
C=list(map(int,input().split()))
cost=[0]*N
for i in range(N):
  cost[i]=V[i]-C[i]
ans=0
for i in range(N):
  if cost[i]>0:
    ans+=cost[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):
    profit = v[i] - c[i]
    if profit > 0:
        ans += profit

print(ans)

Solution (Python):
a = int(input())
b = list(input().split())
c = list(input().split())
sa = 0


for i in range(a):
  if int(b[i]) > int(c[i]):
    sa = sa + int(b[i]) - int(c[i])
  else:
    pass
  
print(sa)

Solution (Python):
Number = int(input())
tresure_value = list(map(int , input().split()))
cost = list(map(int , input().split()))
cnt = 0
 
for i in range(len(tresure_value)):
  benefit = tresure_value[i] - cost[i]
  if benefit  > 0:
    cnt = cnt + benefit 
    
print(cnt)

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

X = 0
Y = 0
for i in range(N):
    if Vlist[i] > Clist[i]:
        X += Vlist[i]
        Y += Clist[i]
print(X - Y)

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):
from sys import stdin


def main():
    _ = int(stdin.readline().rstrip())
    Vs = [int(x) for x in stdin.readline().rstrip().split()]
    Cs = [int(x) for x in stdin.readline().rstrip().split()]
    VCs = [x[0] - x[1] for x in zip(Vs, Cs) if x[0] > x[1]]
    print(sum(VCs))


if __name__ == "__main__":
    main()

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

ans = 0

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

Solution (Python):
N = int(input())
V_str = input().split()
C_str = input().split()

V = list(int(n) for n in V_str)
C = list(int(n) for n in C_str)

val = []
for i in range(len(V)):
  val.append(V[i] - C[i])

positive = []
for n in val :
  if n > 0:
    positive.append(n)
  else:
    next

ans = 0
for k in positive :
  ans += k
  
print(ans)

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

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

kei = 0

for val in sa:
    if val > 0:
        kei += val

print(kei)

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

"""
B - Resale
https://atcoder.jp/contests/abc125/tasks/abc125_b

"""
import sys


def solve(values, costs):
    return sum([v - c for v, c in zip(values, costs) if v > c])


def main(args):
    _ = int(input())
    values = [int(v) for v in input().split()]
    costs = [int(c) for c in input().split()]
    ans = solve(values, costs)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Solution (Python):
N = int(input())
Vn = [ int(v) for v in input().split() ]
Cn = [ int(c) for c in input().split() ]

print(sum([ Vn[i]-Cn[i] for i in range(N) if Vn[i]-Cn[i] > 0 ]))

Solution (Python):


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

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

print(gain)

Solution (Python):
n = int(input())
values = list(map(int, input().split()))
costs = list(map(int, input().split()))
maxvalue = sum([value - cost for value, cost in zip(values, costs) if value - cost > 0])
print(maxvalue)

Solution (Python):
num =int(input())
value = list(map(int, input().split()))
cost = list(map(int, input().split()))
total = 0

for i in range(0, num):
  if value[i] - cost[i] > 0:
    total += value[i] - cost[i]

print(total)

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

Solution (Python):

n = int(input())
v = [i for i in map(int, input().split())]
c = [i for i in map(int, input().split())]

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

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

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 += V[i] - C[i] if V[i] > C[i] else 0

print(ans)

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

if not A:
    print(0)
else:
    print(sum(A))

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):
import math

n = int(input())
a = [int(i) for i in input().split()]
c = [int(i) for i in input().split()]
res=0
for i in range(n):
    if(a[i]-c[i]>0):
        res+=(a[i]-c[i])
print(res)

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

Solution (Python):
import numpy as np
n = int(input())
v = np.array([int(i) for i in input().split()])
c = np.array([int(i) for i in input().split()])

v_list = v - c
v_list = np.array(sorted(v_list, reverse=True))

ans = sum(v_list[v_list > 0])
print(ans)

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

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

Solution (Python):

"""
Spyderエディタ

これは一時的なスクリプトファイルです
"""
n = int(input())

v = [0] * n
c = [0] * n

v = [int(s) for s in input().split()]
c = [int(s) for s in input().split()]

ans = []

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

Solution (Python):
N = int(input())
Vs = list(map(int,input().split()))
Cs = list(map(int,input().split()))


def calc(v_sum,c_sum,index):
    if index == N:
        return v_sum - c_sum

    return max(calc(v_sum + Vs[index], c_sum + Cs[index], index + 1),calc(v_sum, c_sum, index + 1))


print(calc(0,0,0))

Solution (Python):
N = int(input())
Vs = list(map(int,input().split()))
Cs = list(map(int,input().split()))


def calc(v_sum,c_sum,index):
    if index == N:
        return v_sum - c_sum

    return max(calc(v_sum + Vs[index], c_sum + Cs[index], index + 1),calc(v_sum, c_sum, index + 1))


print(calc(0,0,0))

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

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

Solution (Python):
input()
Values = list(map(int, input().split()))
Costs = list(map(int, input().split()))
total = 0
for (value, cost) in zip(Values, Costs):
    if value > cost:
        total += value - cost
    
print(total)

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

Rec = []
Chk = []



work = None
for i in range(0, N):
    for j in range(0, N):
        if not(j in Chk) and (work == None or work < V[j] - C[j]):
            work = V[j] - C[j]
            work2 = j
    Chk.append(work2)
    if len(Rec) > 0:
        Rec.append(Rec[i - 1] + work)
    else:
        Rec.append(work)
    work = None

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

Solution (Python):
x = int(input())
m = 0
V = list(map(int, input().split()))
C = list(map(int, input().split()))
for v, c in zip(V, C):
    if v - c >= 0:
        m += (v - c)
print(m)

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

for vnum,cnum in zip(v,c):
    ans += (vnum-cnum) if vnum>cnum else 0

print(ans)

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

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

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]:
    s += v[i] - c[i]
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):
    a = V[i] - C[i]
    if a > 0:
        res = res + a
    else:
        pass

print(res)

Solution (Python):
N = int(input())
V = [int(v) for v in input().split()]
C = [int(c) for c 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(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] >= 0):
        sum += v[i] - c[i]
print(sum)

Solution (Python):
N = int(input())
V_array = [int(V_i_str) for V_i_str in input().split()]
C_array = [int(C_i_str) for C_i_str in input().split()]
ans = sum([max(0, V_array[i] - C_array[i]) for i in range(N)])
print(ans)

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

for i in range(N):
        P.append(V[i]-C[i])
         
result = list(filter(lambda x:x>=1,P))
print(sum(result))

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

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

result = list(filter(lambda x:x>=1,P))
print(sum(result))

Solution (Python):
N = raw_input()
V = raw_input()
C = raw_input()

Va = V.split(" ")
Ca = C.split(" ")

Va = map(lambda x: int(x), Va)
Ca = map(lambda x: int(x), Ca)


X = 0
Y = 0
for v, c in zip(Va, Ca):
  if v > c:
    X += v
    Y += c

print(X - Y)

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

if N < 0 or 20 < N: raise()
for v in V:
    if v < 0 or 50 < v: raise()
for c in C:
    if c < 0 or 50 < c: raise()

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

Solution (Python):
def solve():
    N = int(input())
    V = [int(k) for k in input().split()]
    C = [int(k) for k in input().split()]
    
    ans = 0
    
    for i in range(N):
        if V[i] > C[i]:
            ans += (V[i] - C[i])
    
    print (ans)
    
if __name__ == "__main__":
    solve()

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

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

for i in range(n):
    if v[i] > c[i]:
        ans.append(v[i] - c[i])

print(sum(ans))

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

Solution (Python):
n = int(input())
v,c = list(map(int,input().split())),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())
Vn = list(map(int, input().split()))
Cn = list(map(int, input().split()))
 
X = 0
Y = 0
for i, d in enumerate([v - c for v, c in zip(Vn, Cn)]):
    
    if(d >= 0):
        X += Vn[i]
        Y += Cn[i]
print(X - Y)

Solution (Python):
N = int(input())
Vn = list(map(int, input().split()))
Cn = list(map(int, input().split()))

X = 0
Y = 0
for i, d in enumerate([v - c for v, c in zip(Vn, Cn)]):
    
    if(d >= 0):
        X += Vn[i]
        Y += Cn[i]
print(X - Y)

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

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

N = int(input())
V = getlist()
C = getlist()
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()))

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

print(SUM)

Solution (Python):
num = int(input())
value = list(map(int, input().split()))
cost = list(map(int, input().split()))
result = 0

for i in range(num):
    if value[i] > cost[i]:
        result = result + value[i] - cost[i]

print(result)