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