Stock Exchange
The world financial crisis is quite a subject. Some people are more relaxed while others are quite anxious. John is one of them. He is very concerned about the evolution of the stock exchange. He follows stock prices every day looking for rising trends. Given a sequence of numbers representing stock prices, a rising trend is a subsequence with . John's problem is to find very quickly the longest rising trend.
Input
Each data set stands for a particular set of stock prices. A data set starts with the length of the sequence of numbers, followed by integers.
White spaces can occur freely in the input. The input data are correct and terminate with an end of file.
Output
Print the length of the longest rising trend. For each data set print the answer from the new line.
Examples
There are three data sets. In the first case, the length of the sequence is . The sequence is . The length of the longest rising trend is .