Given an array of numbers, find the length of the longest subsequence (the elements don't have to be next to each other) such that the numbers are strictly increasing.
This is the same task as Longest Increasing Subsequence, except only the length is required - but the array is much bigger, so the solution will not be fast enough.
Input
First line of input will be a single number , the length of the array.
In the next line will be numbers .
Output
A single number - the length of the longest strictly increasing subsequence.
Example
Input
8 3 6 1 2 8 2 4 5
Output
4
The longest strictly increasing subsequence is , with a length of 4.
Constraints