#include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef pair PII; typedef vector VI; typedef vector VVI; #define MP make_pair #define PB push_back #define inf 1000000007 #define rep(i,n) for(int i=0;i<(int)(n);++i) template void Fill(A (&array)[N], const T &val){ std::fill( (T*)array, (T*)(array+N), val ); } #define N 2000000 vector prime; long long mod = 1000000007; bool arr[N]; void Eratosthenes(){ for(int i = 0; i < N; i++){ arr[i] = 1; } for(int i = 2; i < N; i++){ if(arr[i]){ prime.push_back((ll)i); for(int j = 0; i * (j + 2) < N; j++){ arr[i *(j + 2)] = 0; } } } } int main(){ Eratosthenes(); int n; cin >> n; vectorv; //cout << prime[prime.size()-1] << endl; ll s = 2* prime[prime.size()-1]; for(int i=0;is)break; v.PB(prime[i]*prime[j]); } } } for(int i=0;is)break; v.PB(prime[i]*prime[i]*prime[i]); } sort(v.begin(),v.end()); cout << v[n-1] << endl; return 0; }