Cake

No attempts yetTime limit1sMemory limit128 MB

Problem

Friends are baking a birthday cake to celebrate Jaemin's birthday.

To make the cake, bread slices of height $1$ and lengths $W_1, W_2, \dots, W_N$ are baked one after another, in order from $1$ to $N$. All of these slices must be stacked (none may be thrown away) to build a layered cake.

The cake can consist of several layers. The length of a layer is the sum of the lengths of the slices placed on that layer. So that the cake does not collapse, the length of an upper layer must not be greater than the length of the layer directly below it.

Also, a slice baked later may not be placed on a lower layer than a slice baked earlier. In other words, each layer holds a block of consecutively numbered slices, and the slice numbers increase as you go from the bottom layer to the top.

Stacking the cake as high as possible while satisfying all of these conditions, how many layers can you make?

Input

The first line contains the number of slices $N$. ($1 \le N \le 100,000$)

Each of the next $N$ lines contains one slice length $W_i$. ($1 \le W_i \le 10,000$)

Output

Print the maximum number of layers the cake can have.

Hint

For example, if the slice lengths are $1, 2, 3$ in order, they can be stacked as follows.

+----------+
|    3     |
+---+------+
| 1 |   2  |
+---+------+

The bottom layer consists of slices $1$ and $2$ (total length $3$) and the top layer consists of slice $3$ (length $3$), giving two layers.