#include <iostream>

int main(void)
{
    int input;
    while(std::cin >> input){
        bool* table = new bool[input + 1]();
        for(int i=0; i <= input; ++i){
            if(i < 2){
                table[i] = true;
                continue;
            }
            if(table[i] == false){
                for(int j=2;i * j <= input;++j){
                    table[i * j] = true;
                }
            }
        }
        int count = 0;
        for(int i=0;i <= input;++i){
            if(table[i] == false){
                ++count;
            }
        }
        std::cout << count << std::endl;
        delete[] table;
    }
    return 0;
}