_ = input()
print(sum(list(map(int, input().split()))) - int(input()))