#include using namespace std; bool isPrime( long long x ) { if( x < 2 ) return false; if( x == 2 ) return true; if( x % 2 == 0 ) return false; for( long long i = 3; i * i <= x; i += 2 ) { if( x % i == 0 ) return false; } return true; } int main() { int N; cin >> N; long long ans = 1; if( N > 1 ) { vector p; for( long long i = 100000 + 1; p.size() < N; i++ ) { if( isPrime( i ) ) p.push_back( i ); } vector ans1; for( int i = 0; i < N; i++ ) { for( int j = 0; j < N; j++ ) { ans1.push_back( p[i] * p[j] ); } } sort( ans1.begin(), ans1.end() ); unique( ans1.begin(), ans1.end() ); ans = ans1[N - 2]; } cout << ans << endl; }