Subsequence#988

Subsequence

1 second
128 megabytes
Very easy

Given a sequence, find the length of the longest strictly increasing subsequence.

Input

The first line contains the length (1 \leq n \leq 1000) of the sequence. The second line contains the sequence. Each number in the sequence is an integer whose absolute value does not exceed 10^4.

Output

Print the length of the longest strictly increasing subsequence.

Examples

Example 1

Loading
Loading