input = gets.split.map(&:to_i)
nums = []
nums =gets.split.map(&:to_i);
answer = gets().to_i
sum = nums.inject(:+)
p sum - answer