/*http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0009&lang=jp*/

#include <iostream>

#define MAX 999999

using namespace std;

int main()
{
    int n;
    int num_prime[MAX];
    bool prime_flag[MAX];

    for (int i = 1; i < MAX; ++i) {
        if(!prime_flag[i]){
            for (int j = 2; (i+1)*j-1 < MAX; ++j) {
                prime_flag[(i+1)*j-1]= true;
            }
        }
        num_prime[i]=num_prime[i-1]+!prime_flag[i];
    }
    while (cin>>n){
        cout<<num_prime[n-1]<<endl;
    }
    return 0;
}