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