n=int(input()) a=list(input().split()) print(sum(int(i) for i in a)-int(input()))