#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <string>
#include <istream>
 
#define INPUT_FROM_FILE (0)
#if INPUT_FROM_FILE
#include <fstream>
#endif

//素数判定クラス
class PrimeTest{
private:
	std::vector<bool> is_prime_;					//nが素数かどうかをis_prime[n]で判定
	std::vector<unsigned int> prime_numbers_;		//素数の集合

public:
	PrimeTest();

	~PrimeTest();

	const std::vector<unsigned int>& get_prime_numbers() const;

	bool is_prime(unsigned int n);

};


PrimeTest::PrimeTest(){
	is_prime_.push_back(false);	//0
	is_prime_.push_back(false);	//1
	is_prime_.push_back(true);	//2
	is_prime_.push_back(true);	//3

	prime_numbers_.push_back(2);
	prime_numbers_.push_back(3);
}
PrimeTest::~PrimeTest(){}

const std::vector<unsigned int>& PrimeTest::get_prime_numbers() const{
	return prime_numbers_;
}

bool PrimeTest::is_prime(unsigned int n){
	if(n >= is_prime_.size()){
		unsigned int i_s = is_prime_.size();
		is_prime_.resize(n + 1, false);

		//i_sからnまでの各数が素数かどうか判定
		for(unsigned int i = i_s; i <= n; i++){
			unsigned int max_val = int(sqrt((double)i));
			bool b = true;
			for(unsigned int j = 0; j < prime_numbers_.size(); j++){
				if(prime_numbers_[j] > max_val){ break;}
				if(i % prime_numbers_[j] == 0){
					b = false;
					break;
				}
			}
			if(b){
				prime_numbers_.push_back(i);
				is_prime_[i] = true;
			}
		}

	}
	return is_prime_[n];
}

int count_prime(PrimeTest& prime_test, int n){
	int count = 0;

	for(int i = 2; i <= n; i++){
		if(prime_test.is_prime(i)){
			count++;
		}
	}
	return count;
}

 int main(int argc, char **argv){
	int n = 0;
	std::string buf;
	int count = 0;
	PrimeTest prime_test;
 
#if INPUT_FROM_FILE
	std::ifstream ifs("test.txt");
#endif
 
 
#if INPUT_FROM_FILE
	while(std::getline(ifs, buf)){
#else
	while(std::getline(std::cin, buf)){
#endif
		n = std::atoi(buf.c_str());
		count = count_prime(prime_test, n);

		std::cout << count << std::endl;
		
	}
    return 0;
}
