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