Question
Stacking the Shipping Containers

A shipping yard has N containers lined up in a fixed order, with the i-th container having size A_i. A crane operator wants to select some of these containers, keeping their original relative order, to stack on top of each other such that each container in the stack (from bottom to top) is strictly larger than the one below it.

Find the maximum number of containers that can be selected to form such a strictly increasing stack.

Input

The first line contains a single integer KaTeX can only parse string typed expression — the number of containers. If KaTeX can only parse string typed expression, there are no containers.

The second line contains KaTeX can only parse string typed expression integers KaTeX can only parse string typed expression — the size of each container, in yard order.

Output

Print a single integer — the maximum number of containers that can be stacked in strictly increasing order of size, keeping their original relative order.

Example
Example 1:
Input
8

10 9 2 5 3 7 101 18
Output
4
Explanation
Selecting containers of size KaTeX can only parse string typed expression (in that relative order from the yard) forms a valid strictly increasing stack of 4 containers, which is optimal.

Example 2:
Input
5

5 4 3 2 1
Output
1
Explanation
The sizes are strictly decreasing, so at most a single container can be selected (any two containers would violate the strictly-increasing requirement).

Example 3:
Input
6

5 5 5 5 5 5
Output
1
Explanation
All containers are the same size, and the stack must be strictly increasing (equal sizes don't count), so only one container can be selected.

Online