#include <iostream>

int main()
{
        int p_table[1000000];
        for(int i = 0; i < 1000000; ++i)
                p_table[i] = i;
        p_table[1] = 0;
        for(int i = 2; i < 1000; ++i)
                if(p_table[i] != 0)
                        for(int j = 2; j * i < 1000000; ++j)
                                p_table[i*j] = 0;

        int n, count;
        while(std::cin >> n)
        {
                count = 0;
                for(int i = 0; i <= n; ++i)
                        if(p_table[i] != 0)
                                ++count;
                std::cout << count << std::endl;
        }
        return 0;
}