n, x = list(map(int, input().split())) A = list(map(int, input().split())) print(max(0, sum(A)-x))