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