#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <cmath>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <iostream>
#include <random>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include <fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <bitset>
using namespace std;

using ll = long long;
using vll = vector<long long>;
using pll = pair<long long, long long>;
#define rep(i,n) for(long long i(0);(i)<(n);(i)++)
ll INF = 1LL << 60;

//* calculate primes using sieve
ll sieve(ll n, vll &prime, vector<bool> &isprime){
    //* return the number of primes <= n
    //* prime[0]~ prime[p-1] record the primes
    //* isprime[0] ~ isprime[n] records the sieve
    ll p = 0;
    rep(i, n+1)
        isprime[i] = true;
    isprime[0] = isprime[1] = false;
    for(ll i=2; i <= n; i++){
        if(isprime[i]){
            prime[p++] = i; 
            for(ll j= 2*i; j <= n; j+= i)
                isprime[j] = false;
        }
    }
    return p;
}
int main(){
    vll prime(1000000);
    vector<bool> isprime(1000000);
    ll num = sieve(999999LL, prime, isprime);
    vll rec(1000000, 0);
    for(ll i=2; i< 1000000; i++){
        if(isprime[i])
            rec[i] = 1;
    }
    for(ll i=1; i< 1000000; i++){
        rec[i]+= rec[i-1];
    }

    ll n;
    while(cin >> n){
        cout << rec[n] << endl;
    }
    return 0;
}
