#include <iostream>
#include <memory.h>
using namespace std;

int prime[1000000];
void initTbl(){
	//sieve of Eratosthenes
	// 0 : prime
	// 1 : not prime
	memset(prime, 0, sizeof(prime));
	prime[0] = 1;
	prime[1] = 1;

	int limit = 1000000;
	for(int i=4; i<limit; i+=2){
		prime[i] = 1;
	}

	for(int j=3; j*j<=limit; j+=2){
		for(int k=j; j*k<=limit ;k+=2){
			prime[j*k] = 1;
		}
	}
}

//0009
int main()
{
	int n=10;
	initTbl();

	while(cin >> n){
		int cnt = 0;

		for(; n>0; n--){
			if(!prime[n])
				++cnt;
		}
		cout << cnt << endl;

	}
  return 0;
}