CSES - Increasing Subsequence
  • Time limit: 1.00 s
  • Memory limit: 512 MB

You are given an array containing nn integers. Your task is to determine the longest increasing subsequence in the array, i.e., the longest subsequence where every element is larger than the previous one.

A subsequence is a sequence that can be derived from the array by deleting some elements without changing the order of the remaining elements.

Input

The first line contains an integer nn: the size of the array.

After this there are nn integers x1,x2,,xnx_1,x_2,\ldots,x_n: the contents of the array.

Output

Print the length of the longest increasing subsequence.

Constraints

  • 1n21051 \le n \le 2 \cdot 10^5
  • 1xi1091 \le x_i \le 10^9

Example

Input:

8
7 3 5 3 6 2 9 8

Output:

4