#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef vector vi; typedef pair pii; #define MP make_pair #define PB push_back #define inf 1000000007 #define rep(i,n) for(int i = 0; i < (int)(n); ++i) #define all(x) (x).begin(),(x).end() template void Fill(A (&array)[N], const T &val){ std::fill( (T*)array, (T*)(array+N), val ); } template inline bool chmax(T &a, T b){ if(a inline bool chmin(T &a, T b){ if(a>b){ a = b; return true; } return false; } #define MAX_N 200005 vector prime; bool is_prime[MAX_N]; void sieve(int n){ for(int i=0;i<=n;i++){ is_prime[i] = true; } is_prime[0] = is_prime[1] = false; for(int i=2;i<=n;i++){ if(is_prime[i]){ if(i>100000)prime.push_back(i); for(int j=2*i;j<=n;j+=i){ is_prime[j] = false; } } } } int main(){ sieve(200000); int n; cin >> n; cerr << prime[0] << endl; if(n==1)cout << 1 << endl; else cout << prime[n-2] << endl; return 0; }