lines = STDIN.read.split("\n")

values = lines[1].split(' ').map(&:to_i)
costs = lines[2].split(' ').map(&:to_i)

res = values.zip(costs).reduce(0) { |acc, (v, c)| v > c ? (acc + v - c) : acc }

puts res
