N, K = map(int, input().split()) A = list(map(int, input().split())) print(max(0, sum(A)-K))