n = gets.to_i
value = gets.split(" ").map(&:to_i)
cost = gets.split(" ").map(&:to_i)

v_c = []
for i in 0..n-1
  array = value[i] - cost[i]
  v_c << array
end

if v_c.all?{|item| item < 0}
  puts 0
  exit
end
puts v_c.select{|item| item >= 0}.inject(:+)