N = int(input()) A = [int(i) for i in input().split()] print(sum(A) - int(input()))