Problem2219--递增序列有多长

2219: 递增序列有多长

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MiB

Description

在数列 a1,a2,,an 中,如果 ai<ai+1<ai+2<<aj,则称 ai 至 aj 为一段递增序列,长度为 ji+1

定一个数列,请问数列中最长的递增序列有多长。

Input

输入的第一行包含一个整数 n(2<=n<=2000)

第二行包含 n 个整数 a1,a2,,an(0≤ai≤10000 ,相邻的整数间用空格分隔,表示给定的数列。

Output

输出一行包含一个整数,表示答案。

Sample Input Copy

7
5 2 4 1 3 7 2

Sample Output Copy

3

Source/Category

admin