input() t = sum(map(int,input().split())) f = int(input()) ans = t - f print(ans)