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