#include<iostream>
#include<cmath>

using namespace std;

bool isprime(int x);

int main() { 
    int prime; 

    while( cin >> prime ) {

	int count = 0;
	
	for(int i=1;i<=prime;i++) 
		count += isprime(i);
		
    cout << count << "\n";
	}
    return 0; 
} 

bool isprime(int x) {
	
	if ( x == 2)
	return true;
	
	if( x < 2 || x % 2 == 0 )
	return false;
	
	int i = 3;
	
	while( i <= sqrt(x) ) {
		
		if( x % i == 0 )
		return false;
		i += 2;
		
	}
	return true;
}
