n = input() a_list = list(map(int,input().split(' '))) v = int(input()) print(sum(a_list) -v)