n = gets.to_i ans = gets.split.map(&:to_i).inject(0,&:+) - gets.to_i puts ans