#include <iostream>
using namespace std;

int p[1000000],size;

bool isPrime(int x){
	for(int i=0;p[i]*p[i]<=x;i++){
		if(x % p[i] == 0) return false;
	}
	return true;
}

void mkPrime(int n){
	size = 0;
	p[size++] = 2;
	for(int i=3;i<=n;i+=2){
		if(isPrime(i)){
			p[size++] = i;
		}
	}
}


int main(void){
	mkPrime(1000020);

	int n;	
	while(cin>>n){
		int ans = 0;
		for(int i=0;p[i]<=n;i++){
			ans++;
		}
		printf("%d\n",ans);
	}

	return 0;
}