Message
InterviewTime limit2sMemory limit1024 MB
Given k, find the k-th smallest prime p such that 2p + 1 is also prime.
- Level
Easy3 of 10
- Topics
- Number theory, Implementation
- Solved
- No attempts yet
Problem
Petya and Vasya keep playing spies. This time Petya sent Vasya an encoded message. The two keys for decoding it are prime numbers and . Petya told Vasya that these numbers satisfy , and that is the -th smallest prime for which such a prime exists.
Help Vasya read the message by finding this .
Input
The only line of the input file contains an integer (), the ordinal number of .
Output
Print the single number to the output file.