A numeric sequence of a_{i} is ordered if a_{1} < a_{2} < ... < a_{N}. Let the subsequence of the given numeric sequence (a_{1}, a_{2}, ., a_{N}) be any sequence (a_{i1}, a_{i2}, ., a_{iK}), where 1 ≤ i_{1} < i_{2} < ... < i_{K} ≤ N. For example, the sequence (1, 7, 3, 5, 9, 4, 8) has ordered subsequences, e. g., (1, 7), (3, 4, 8) and many others. All longest ordered subsequences of this sequence are of length 4, e. g., (1, 3, 5, 8).

Your program, when given the numeric sequence, must find the length of its longest ordered subsequence.

Input file format

The first line of input file contains the length of sequence N. The second line contains the elements of sequence - N integers in the range from 0 to 10000 each, separated by spaces.

Output file format

Output file must contain a single integer - the length of the longest ordered subsequence of the given sequence.