Problem C: 小明的身高记录

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:29 Solved:12

Description

小明记录了班里 n 名同学从矮到高排成一排时,每人的身高(单位:cm)。 现在给你一个乱序的身高数组,请找出最长的严格递增子序列的长度 (可以不连续,但顺序要保持)。
输入:n=8; a = [148138153138158178143163]

输出:4   (138153158178 )



Input

第一行为学生数 n。第二行为 n名学生的身高。

Output

输出只有一个数字,为递增子序列的长度。

Sample Input Copy

8
148 138 153 138 158 178 143 163

Sample Output Copy

4

HINT

n<=1000