N, X = map(int, input().split()) A = sum(map(int, input().split())) if X >= A: print(0) else: print(A-X)