N = int(input()) A = list(map(int, input().split())) V = int(input()) Z = 0 for x in A : Z = Z + x print(Z - V)