#include using namespace std; int main() { int N; cin >> N; vector v( 1000000 + 1, true ); for( int i = 2; i <= 100000; i++ ) { if( v[i] ) { for( int j = 2 * i; j <= 1000000; j += i ) { v[ j ] = false; } v[i] = false; } } int n = 0; int ans = 1; for( int i = 1; i < 1000000 + 1; i++ ) { if( v[i] ) { n++; if( n >= N ) { ans = i; break; } } } cout << ans << endl; }