N = int(input()) A = list(int, input().split()) v = int(input()) i=0 for value in A: i += value print(i-v)