#include <iostream>
#include <iomanip>
#include <list>
#include <map>
#include <algorithm>
#include <stack>
#include <string>
#include <vector>

#define MAX 999999

using namespace std;


int main(){
	int n = 0;
	int count;
	bool flag = false;
	vector<int> sosu;
	sosu.push_back(0);
	sosu.push_back(0);
	sosu.push_back(1);

	count = 1;
	for(int i = 3; i <= MAX; i += 2){
		for(int j = 3; j * j <= i; j += 2){
			if(i % j == 0){
				flag = true;
				break;
			}
		}
		if(flag != true){
			count++;
		}
		else{
			flag = false;
		}
		sosu.push_back(count);
		sosu.push_back(count);
	}
	

	while(cin >> n){
		cout << sosu[n] << endl;	
	}

	return 0;
}