#include<iostream>
#include<stdio.h>
#include<windows.h>
#include<conio.h>
#include<String>
#include<time.h>
#include<math.h>

using namespace std;

int main() {

	int c = 0;
	int i = 1;
	unsigned long long a = 0;
	unsigned long long b = 0;
	unsigned long long sosuu[100000] = { 0 };
	char fire = 0;
	int pattara = 0;
	cin >> c;
	cout << 2;
	/*while(i>-1)*/for(int i=0;i<c;i++){
		/*for (int z = 0; z < a;z++){*/
		for (int q = 1; q <= sqrt(i); q++) {
			sosuu[pattara] = i;
			if (sosuu[pattara] % 2 == 0) {
				break;
			}
			if (sosuu[pattara] % q == 0) {
				b += 1;
			}

		}

		/*if (b == 1) {
			fire = _getch();
			pattara++;
			cout << sosuu[pattara - 1] << " " << pattara << endl;

		}*/
		b = 0;
		/*i++;*/
		if (pattara == c){
			break;
		}
	}
	cout << pattara << endl;


	/*system("pause");
	return 0;*/
}