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