N,X = map(int, input().split()) A = list(map(int, input().split())) sum = sum(A) if sum > X: print(sum-X) else: print(0)