A dwarf loves sledding down a hill along a toboggan track. At the moment he sets off (the very start), the sled's speed is 0. The track is divided into N segments, and for each segment you are told how the sled's speed changes after passing it: it increases or decreases by ai m/s.
The dwarf's sled is smart — it measures its speed and slows itself down when necessary. If, at the junction between two segments, the sled's speed exceeds S m/s, the sled brakes and its speed decreases by 1 m/s. Braking happens only at junctions between segments, never at the very end of the track.
Determine the speed at which the sled reaches the bottom of the hill (after passing the last segment).
The first line contains the number of segments N and the threshold speed S. Whenever the speed exceeds S, the sled is braked.
Each of the next N lines contains a single integer ai — how much the sled's speed changes after passing the corresponding segment.
Output the sled's speed at the end of the track.
The input is always such that the sled is guaranteed to finish the whole track, i.e. the speed never drops to 0 (except possibly at the very end of the track).