N = int(input()) X = int(input()) A = list(map(int, input().split())) Y = sum(A) Z = Y - X print(Z)