nagasa = int(input()) i = input().split() yuki = int(input()) total = 0 for k in i: total += int(k) print(int(total - yuki))