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

Solution (Python):

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

total = 0
for vi, ci in zip(v, c):
    if vi - ci > 0:
        total += vi - ci

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

Solution (Python):
N = int(input())
vs = [int(item) for item in input().split()]
cs = [int(item) for item in input().split()]
ans = 0
for v, c in zip(vs, cs):
  if v >= c:
    ans += v-c
print(ans)

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

diff = [v - c for v,c in zip(V, C) if v - c > 0]
result = int(sum(diff))
print(result)

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

Solution (Python):
import collections as c
ip = lambda : map(int, input().split())


N = int(input())
v = list(ip())
c = list(ip())
l = [i-j for i,j in zip(v,c)]
l.sort(reverse=True)
ans = 0
for i in l:
    if i>0:
        ans += i
    else:
        break
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):
    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()))
ans = 0

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

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

print(res)

Solution (Python):

n = int(input())

Vn = list(map(int,input().split()) )
Cn = list(map(int,input().split()) )


ans = 0
for i in range(n):
    t = Vn[i] - Cn[i]

    if t > 0:
        ans += t


print(ans)

Solution (Python):
n = int(input())
listV = list(map(int, input().split()))
listC = list(map(int, input().split()))
listXY=[]
index=0
while index < len(listV):
    listXY.append(listV[index]-listC[index])
    index+=1
listXY.sort()
listXY.reverse()
index2=0
maxD=0
while index2 < len(listXY):
    if listXY[index2] > 0:
        maxD+=listXY[index2]
    else:
        break
    index2+=1
print(maxD)

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

x = list(map(int, input().split()))
y = list(map(int, input().split()))

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

Solution (Python):


def readInts():
  return [int(s) for s in input().split(" ")]

def main():
  N = readInts()[0]
  V = readInts()
  C = readInts()
  ans = 0
  for n in range(N):
    ans += max(0, V[n] - C[n])
  print(ans)

if __name__ == "__main__":
  main()

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

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

ans = 0

for i, j in zip(V,C):
    ans += max(0, i-j)
print(ans)

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

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

Solution (Python):


import sys


INF = float('inf')
MOD = 10 ** 9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()


def main():
    n = II()
    V = LI()
    C = LI()

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

    return res


print(main())

Solution (Python):


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

vc = []
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):
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 sys

def main():
    input = sys.stdin.readline
    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])

    return ans


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

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=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):
    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()))
print(sum([max(V[i] - C[i], 0) for i in range(N)]))

Solution (Python):
from sys import exit
N = int(input())
V = [int(n) for n in input().split()]
C = [int(n) for n in input().split()]
VC=[0]*N
for i in range(N):
    VC[i] = (V[i],C[i])
VC = sorted(VC,key=lambda x:-x[0])
ans = 0
for i in range(N):
    if(VC[i][0] > VC[i][1]):
        ans+=VC[i][0] - VC[i][1]
print(ans)

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

gap = 0

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

print(gap)

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

x = [0]*N
for i in range(N):
	x[i] = v[i]-c[i]

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

Solution (Python):

import sys
read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_matrix(H):
    '''
    H is number of rows
    '''
    return [list(map(int, read().split())) for _ in range(H)]


def read_map(H):
    '''
    H is number of rows
    文字列で与えられた盤面を読み取る用
    '''
    return [read() for _ in range(H)]


def read_col(H, n_cols):
    '''
    H is number of rows
    n_cols is number of cols

    A列、B列が与えられるようなとき
    '''
    ret = [[] for _ in range(n_cols)]
    for _ in range(H):
        tmp = list(map(int, read().split()))
        for col in range(n_cols):
            ret[col].append(tmp[col])

    return ret


N = read_a_int()
V = read_ints()
C = read_ints()


value = []
for v, c in zip(V, C):
    value.append(v-c)

value.sort(reverse=True)

ans = 0
for v in value:
    if v < 0:
        break
    ans += v

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


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


print(m())

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_arr = list(map(int, input().split()))
C_arr = list(map(int, input().split()))

ans = 0
for i in range(N):
    if V_arr[i] > C_arr[i]:
        ans += V_arr[i] - C_arr[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):
    ans += max(0,v[i]-c[i])
print(ans)

Solution (Python):
import atexit
import io
import sys

buff = io.BytesIO()
sys.stdout = buff


@atexit.register
def write():
    sys.__stdout__.write(buff.getvalue())

n = input()
v = map(int, raw_input().split())
c = map(int, raw_input().split())
arr = []
ans = 0
for i in xrange(n):
	arr.append(v[i]-c[i])
arr.sort(reverse = True)
for i in xrange(n):
	if arr[i] > 0:
		ans += arr[i]
	else:
		break
print ans

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

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N = INT()
V = LIST()
C = LIST()

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



count= 0
for x in V_C:
	if x > 0:
		count += x

print(count)

Solution (Python):

N=int(input())
V = [int(j) for j in input().split()]
C = [int(j) for j 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 = list(map(int, input().split()))
C = list(map(int, input().split()))
X = 0
Y = 0
for v, c in zip(V, C):
    if v > c:
        X += v
        Y += c
print(X - Y)

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

def main():
    n = int(input())
    a = input_ints()
    b = input_ints()
    ans = 0
    for i in range(n):
        if a[i] > b[i]:
            ans += a[i] - b[i]
    print(ans)

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

print(sum([v-c for v,c in zip(V,C) if v-c>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):

if __name__ == "__main__":
    n = int(input())
    v = list(map(int, input().split()))
    c = list(map(int, input().split()))
    res = 0
    for vv,cc in zip(v,c):
        if vv-cc > 0:
            res += vv-cc
    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 C[i] < V[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]:
		ans += V[i] - C[i]
print(ans)

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

print(ans)

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

Solution (Python):
import sys
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n = ni()
v = na()
c = na()

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

a=0
for j in k:
    if j >0:
        a+=j
print(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):
N=int(input())

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

Solution (Python):
n = int(input())
v = list(map(int ,input().split()))
c = list(map(int ,input().split()))
cnt = []
for i in range(n):
        cnt.append(v[i]-c[i])
ans = 0
for i in range(n):
        if cnt[i]>=0:
                ans += cnt[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 inpl(): return list(map(int, input().split()))
N = int(input())
V = inpl()
C = inpl()
print(sum([max(v-c, 0) for v, c in zip(V, C)]))

Solution (Python):
N = int(input())
V, C = [list(map(int, input().split(" "))) for _ in range(2)]

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

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

Solution (Python):

import copy
import random
import bisect 
import fractions 
import math


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

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

res = 0
for i in range(n):
    if v_array[i] < c_array[i]:
        continue
    else:
        res += v_array[i]- c_array[i]

print(res)

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

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

ans = [V[i] - C[i] for i in range(N) if V[i] - C[i] > 0]
print(sum(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):
from functools import reduce
import math

def main():
    
    
    
    

    
    
    
    
    
    

    
    

    
    
    
    
    
    
    
    
    
    INF = float("inf")

    
    MOD = 10**9+7
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    N = int(input().rstrip())
    V = list(int(_) for _ in input().split())
    C = list(int(_) for _ in input().split())
    ans = 0
    for i in range(N):
        if(C[i] < V[i]):
            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()))
X = [V[i] - C[i] for i in range(N)]
a = 0
for i in range(N):
    if X[i] > 0:
        a += X[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]:
        total += a[i]-b[i]
print(total)

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):
    ans += max(0, i-j)

print(ans)

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


main()

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

Solution (Python):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    n = f()[0]
    v = f()
    c = f()
    a = 0
    for i in range(n):
        if v[i] - c[i]>0:
            a+= v[i] - c[i]
    print(a)

solve()

Solution (Python):
n = int(input())
v = list(map(int,input().split()))
c = list(map(int,input().split()))
def dfs(cnt,a):
    if cnt==n:
        return a
    ret1 = dfs(cnt+1,a+v[cnt]-c[cnt])
    ret2 = dfs(cnt+1,a)
    return max(ret1,ret2)
print(dfs(0,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):
    temp = V[i] - C[i]
    if temp > 0:
        ans += temp
print(ans)

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

print(sum([max(0,V[x]-C[x]) for x in range(N)]))

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

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

ans = 0
for e in info:
    if e > 0:
        ans += e

print(ans)

Solution (Python):
from heapq import heappush,heappop
import queue
import re

def int_raw():
    return int(input())

def ss_raw():
    return input().split()

def ints_raw():
    return list(map(int, ss_raw()))

INF = 1<<29

def make1d_arr(n,val=INF):
    return [val for i in range(n)]

def make2d_arr(h,w,val =INF):
    return [[val for i in range(w)]for i in range(h)]


N = int_raw()
V = ints_raw()
C = ints_raw()


def main():
    D= [V[i]-C[i] for i in range(N)]
    return sum([d for d in D if d > 0])
    
print(main())

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):
I=lambda:list(map(int,input().split()))
N=int(input())
V=I()
C=I()
print(sum(max(V[i]-C[i],0)for i in range(N)))

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

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

Solution (Python):
from operator import itemgetter
import sys
sys.setrecursionlimit(1000000)
ans=0

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

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

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])
diff = [diff[i] for i in range(N) if diff[i] > 0]
print(sum(diff))

Solution (Python):
n = int(input().strip())
vs = [int(v) for v in input().strip().split()]
cs = [int(v) for v in input().strip().split()]
tot = 0
for v, c in zip(vs, cs):
    if v > c:
        tot += v - c
print(tot)

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

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

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

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

A = [int(i) for i in input().split()]
B = [int(i) for i in 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 i,j in zip(v,c):
    if i - j > 0:
        ans += i - j
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] > 0):
        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 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()))

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

print(x)

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

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

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




if __name__ == '__main__':
    main()

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

Solution (Python):
n = int(input())
vv = list(map(int, input().split()))
cc = list(map(int, input().split()))

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

Solution (Python):
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

n = ni()
v = list(li())
c = list(li())

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

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

VC = []

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

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


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

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):
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque, OrderedDict
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from math import ceil, floor
from sys import setrecursionlimit

import heapq
import itertools
import operator



inf = float('inf')
N = 0


def set_inputs():
    global N
    return


def main():
    setrecursionlimit(100000)
    set_inputs()
    
    n = get_int()
    v = get_li()
    c = get_li()
    print(sum(max(vi-ci, 0) for vi, ci in zip(v, c)))
    return


def get_int():
    return int(input())


def get_float():
    return float(input())


def get_str():
    return input().strip()


def get_li():
    return [int(i) for i in input().split()]


def get_lf():
    return [float(f) for f in input().split()]


def get_lc():
    return list(input().strip())


def get_data(n, types, sep=None):
    if len(types) == 1:
        return [types[0](input()) for _ in range(n)]
    return list(zip(*(
        [t(x) for t, x in zip(types, input().split(sep=sep))]
        for _ in range(n)
    )))


if __name__ == '__main__':
    main()

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

ans = 0
for v, c in zip(V, C):
    x = v - c
    if x > 0:
        ans += x
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):
    kari=V[i]-C[i]
    if kari > 0:
        count+=kari
print(count)

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

Solution (Python):
from itertools import product

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

ans = -10**18
for p in product([0, 1], repeat=N):
    res = 0
    for i, e in enumerate(p):
        if e:
            res += V[i] - C[i]
    ans = max(ans, res)
print(ans)

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

import sys


def solve(N: int, V: "List[int]", C: "List[int]"):
    ret = 0
    for v, c in zip(V, C):
        ret += max(0, v - c )
    print(ret)


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

print(sum([max(V[i] - C[i], 0) for i in range(N)]))