N = int(input()) realAns = [int(x) for x in input().split()] yukiAns = int(input()) print(sum(realAns) - yukiAns)