#include <iostream>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;

const int N = 100000;

int main(void)
{
    bool a[N];
    int prime[N], n, count = 0;
    rep(i,N)
    a[i] = true;
    a[0] = a[1] = false;
    for(int i=2;i*i<=N;i++)
    {
        if(a[i])
        {
            prime[i] = prime[i-1] + 1;
            for(int j=i*i;j<N;j+=i)
                a[j] = false;
        }
        else
            prime[i] = prime[i-1];
    }
    
    while(cin >> n)
    {
        rep(i,n+1)
        {
            if(a[i])
                count++;
        }
        cout << count << endl;
    }
    
    return 0;
}