#include<iostream>

int n;
bool *isPrime;

int solve(){
	int p = 0;
	for(int i=0; i<=n; i++)
		isPrime[i] = true;
	isPrime[0] = isPrime[1] = false;
	for(int i=2; i<=n; i++){
		if(isPrime[i]){
			p++;
			for(int j=2*i; j<=n; j+=i)
				isPrime[j] = false;
		}
	}
	return p;
}

int main(){
	while(std::cin >> n){
		isPrime = new bool[n+1];
		std::cout << solve() << std::endl;
		delete[] isPrime;
	}
	return 0;
}