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