n=int(input()) print(sum(list(map(int,input().split())))-int(input()))