a = gets b = gets.split(" ").map(&:to_i).sum c = gets.to_i puts b - c