n = gets.chomp.to_i
values = gets.chomp.split(' ').map(&:to_i)
costs = gets.chomp.split(' ').map(&:to_i)
values_array = Array.new
costs_array = Array.new
n.times do |time|
  if values[time] > costs[time]
    values_array << values[time]
    costs_array << costs[time]
  else
    values_array << 0
    costs_array << 0
  end
end
p values_array.inject(:+) - costs_array.inject(:+)
