n, x = map(lambda s_: int(s_), input().split()) a = tuple(map(lambda s_: int(s_), input().split())) ans = max(sum(a) - x, 0) print(ans)