#include <iostream>
using namespace std;

bool isprime(int n){
	if(n < 2)return false;
	
	for(int i=2;i*i<=n;i++)
		if( n%i == 0)return false;
	return true;
}
int main(){
	int n;
	bool memo[1000000] = {false};
	for(int i=0;i<1000000;i++){
		memo[i] = isprime(i);
	}
	while(cin >> n){
		int output = 0;
		for(int i=0;i<=n;i++){
			if(memo[i])output++;
		}
		cout << output << endl;
	}
}