#C7916. Longest Increasing Prime Subsequence

    ID: 51840 Type: Default 1000ms 256MiB

Longest Increasing Prime Subsequence

Longest Increasing Prime Subsequence

You are given a list of integers. Your task is to determine the length of the longest strictly increasing subsequence formed by the prime numbers extracted from the list. Only prime numbers should be considered, and if there are no prime numbers in the input, the answer is 0.

The subsequence is determined after sorting the prime numbers from the input. In the case of duplicate prime numbers, only one instance is counted as the sequence must be strictly increasing.

Read from standard input and output the result to standard output.

inputFormat

The first line contains an integer n, representing the number of integers.

The second line contains n space-separated integers.

outputFormat

Output a single integer: the length of the longest strictly increasing subsequence of prime numbers.

## sample
6
10 2 3 5 7 11
5