/*
P135
AOJ 0009 Prime Number
Difficult: 2
*/

#include <iostream>
#include <map>
#include <set>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <functional>
#include <string.h>
#include <cmath>

using namespace std;

const int MAXN = 999999;
int prime[MAXN + 1], pn;
int mindiv[MAXN + 1];

void GetPrime(int n)
{   //determin each num (that <= n) is prime or not.
    //and get primes into an array with pn elements
    //mindiv[i] == i means it is a prime
    fill(mindiv, mindiv+n+1, 0);
    pn = 0;
    for(int i=2; i<=n; ++i){
        if(mindiv[i] == 0) mindiv[i] = i, prime[pn++] = i;
        for(int p=0; p<pn && i*(long long)prime[p] <= n; ++p){
            mindiv[prime[p]*i] = prime[p];
            if(prime[p] == mindiv[i]) break;
        }
    }
}


int main()
{
    GetPrime(MAXN);
    int n;
    while(scanf("%d", &n) !=EOF){
        int x = upper_bound(prime, prime + pn, n) - prime;
        printf("%d\n", x);
    }

}