#include <iostream>

using namespace std;

int count_prime(int n)
{
    int c = 0;
    bool ps[n+1];

    ps[0] = false;
    ps[1] = false;

    for(int i = 2; i <= n; ++i)
        ps[i] = true;

    for(int i = 2; i <= n; ++i){
        if(ps[i]){
            for(int j = i * 2; j <= n; j += i)
                ps[j] = false;
        }
    }

    for(int i = 1; i <= n; ++i){
        if(ps[i])
            ++c;
    }
    return c;
}

int main()
{
    int n;
    int c;

    while(cin >> n){
        c = count_prime(n);
        cout << c << endl;
    }
    return 0;
}