Superprime numbers.
Andriyko was sitting in biology class, feeling bored, and decided to entertain himself with some number exercises. He remembered learning about prime numbers in math class. (Recall that a prime number is a number greater than one that has exactly two divisors: one and itself.)
Andriyko wrote down the prime numbers in ascending order and labeled the i-th number in this sequence as p[i]
. (For example, p[1] = 2
, p[2] = 3
, p[3] = 5
, p[52] = 239
.) He then challenged himself further by identifying those prime numbers whose positions in the list of primes are also prime numbers. He called these numbers super-primes. After listing all the super-primes in ascending order, Andriyko decided to find the one that is in the k-th position.
Input
The input consists of a single line containing the number k, where 1 ≤ k ≤ 5000.
Output
The output should be a single line containing the super-prime number that is the k-th in the ordered sequence of super-prime numbers.