n = input() l = (int(x) for x in input().split()) print(sum(l) - int(input()))