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