#include <cstdio>
#include <iostream>

using namespace std;

bool is_prime(const unsigned n);


int main(){
	int n;

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

		for(int number=2;number<=n;number++){
			if(is_prime(number))ans++;
		}
		printf("%d\n",ans);
	}


	return 0;
}

bool is_prime(const unsigned n){
    switch(n){
        case 0: 
        case 1: return false;
        case 2: 
        case 3: return true;
    } 

    if(n%2 == 0) return false;
    if(n%3 == 0) return false;

    if(n%6 != 1 && n%6 != 5) return false;

    for(unsigned i=5;i*i<=n;i+=6){
        if(n%i     == 0) return false;
        if(n%(i+2) == 0) return false;
    }

    return true;}