Competition of sequences
Ziya will take part in the sequence competition tomorrow. The number is called the top of some sequence if the sequence is a subsequence of this sequence. The strength of each sequence is considered to be its largest vertex.
Tomorrow all students will go to the competition and the winner of the strongest sequence will be the winner. Zia has the sequence . He wants to take over the competition scoring system and remove sequences from it with more force than himself. However, Zia does not know the power of his own consistency, but really wants to win. Help him calculate the strength of his own sequence.
Input
The first line contains the number of numbers in Zia's sequence. The next line contains integers — the elements of the sequence.
Output
Print one number — the strength of the given sequence.