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