import sys input = sys.stdin.readline N,X=list(map(int,input().split())) A=list(map(int,input().split())) ANS=sum(A)-X print(max(0,ANS))