N = gets.to_i
A = gets.split.map(&:to_i)
V = gets.to_i

puts A.sum - V