n = int(input()) a = sum(list(map(int,input().split()))) b = int(input()) print(a-b)