n=gets.to_i
v = gets.split.map(&:to_i)
c = gets.split.map(&:to_i)
f=0
 
0.upto((1<<n)-1) do |bit|
  tmp = 0
  0.upto(n-1) do |i|
    if (bit>>i)&1 == 1
      tmp += v[i]-c[i]
    end
  end
  
  if tmp > f
    f = tmp
  end
  
end
 
p f