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