#include using namespace std; using ll = long long; template using Pa = pair; template using vec = vector; template using vvec = vector>; int main(){ cin.tie(0); ios::sync_with_stdio(false); vec prime; for(int i=1e5+1;i<=2e5;i++){ int n = i; bool ok = true; for(int j=2;j*j<=n;j++){ ok &= n%j!=0; } if(ok) prime.push_back(i); if(prime.size()==10){ break; } } vec ans; for(auto& x:prime) for(auto& y:prime) ans.push_back(x*y); sort(ans.begin(),ans.end()); int N; cin >> N; if(N==1) cout << 1 << "\n"; else cout << ans[N-2] << "\n"; }