N=input() s=input().split() f=int(input()) h=0 for i in s: h+=int(i) print(h-f)