N = int(input()) A = list(map(int,input().split())) ans = sum(A) yuki = int(input()) print(ans - yuki)