Gas Stations

2.4

121 votes
Approved, Easy, Math, Number theory
Problem

Xenny's is competing in a race and his car has X litres of fuel. There are N milestones in the competition. It takes no fuel at all to travel between gas stations, but at the ith gas station, Pi amount of petrol is drained.

Find the number milestones Xenny crosses before his car gets out of fuel.

Input

The first line of input consists of 2 space-separated integers - N and X.

The second line contains N space-separated integers - Pi

Output

Print a single integer - the number of milestones Xenny crosses.

Constraints

1N100

1X109

1Pi109

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

Initial fuel = 7

After visiting the first station, the fuel left is 6 litres.

After visiting the second station, no fuel is left as all of it is drained out.

Hence, 2 stations are visited.

Editor Image

?