#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
using namespace std;

bool isprime (int n){

	if (n == 0 || n == 1){
		return false;
	}else if (n == 2){
		return true;
	}else if (n % 2 == 0){
		return false;
	} // end if
	
	for (int i = 3; i <= sqrt(n); i+= 2){
		if (n % i == 0){
			return false;
		} // end if
	} // end for
		
	return true;
}

int main()
{
	
//	cut here before submit 
//	freopen("testcase.prime", "r", stdin);
	string str = "";
	vector <int> prime(1000000, 0);

	int count = 0;
	for (int i = 2; i < 1000000; ++i){
		if (isprime(i)){
			++count;
		} // end if
		prime[i] = count;
	} // end for	

	while (getline (cin, str )){
		int n = 0;
		stringstream ssn(str);
		ssn >> n;
		cout << prime[n] << endl; 
	} // end while

	return 0;
}