input() deta=[int(i) for i in input().split()] yuki=int(input()) print(sum(deta)-yuki)