#include <iostream>
#include <cmath>
using namespace std;
// have you mooed today?
bool isprime(int& num)
{
    static int c;
    static int max;
    if(num == 2) return true;
    if(num % 2 == 0) return false;
    max = ceil(sqrt(num));

    for(c=3; c < max+1; c+=2)
        if(num % c ==0) return false;
    return true;
}

main()
{
    int ans;
    int buff;
    while(cin >> buff)
    {
        ans  = 0;
        for(int d =2; d <= buff; d++)
        {
            if(isprime(d)) ans++;
        }
        cout << ans << endl;
    }
}