N = gets.to_i
V_n = gets.split.map(&:to_i)
C_n = gets.split.map(&:to_i)

ans = 0
[0, 1].repeated_permutation(N).to_a.each do |p|
  v = 0
  c = 0
  p.each.with_index do |i, idx|
    v += V_n[idx] if i == 1
    c += C_n[idx] if i == 1
  end
  ans = [ans, v - c].max
end
p ans