n, x = map(int, input().split()) a = list(map(int, input().split())) if sum(a) > x: print(sum(a) - x) else: print(0)