#P171F. ucyhf

    ID: 8962 Type: RemoteJudge 2000ms 64MiB Tried: 0 Accepted: 0 Difficulty: 5 Uploaded By: Tags>*special problembrute forceimplementationnumber theory*1600

ucyhf

Description

qd ucyhf yi q fhycu dkcruh mxeiu huluhiu yi q tyvvuhudj fhycu dkcruh. oekh jqia yi je vydt jxu djx ucyhf.

jxu ydfkj sediyiji ev q iydwbu ydjuwuh d (1 ≤ d ≤ 11184) — jxu edu-rqiut ydtun ev jxu ucyhf je vydt.

ekjfkj q iydwbu dkcruh.

Input

jxu ydfkj sediyiji ev q iydwbu ydjuwuh d (1 ≤ d ≤ 11184) — jxu edu-rqiut ydtun ev jxu ucyhf je vydt.

Output

ekjfkj q iydwbu dkcruh.

1

13