N = int(input()) A = list(map(int, input().split())) v = int(input()) sum = 0 for n in range(N): sum += A[n] answer = sum - v print(answer)