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