N, X = [int(s) for s in input().split()] A = [int(s) for s in input().split()] print(max(sum(A) - X, 0))