#include <bits/stdc++.h>
#define rep(i, a) for (int i = 0; i < (a); ++i)
#define REP(i, a, b) for (int i = (a); i < (b); ++i)
#define pb push_back
typedef long long ll;
typedef long double la;
using namespace std;

bool is_prime(int n)
{
    if(n<=1)
        return false;
    for(int i=2; i*i<=n; i++){
        if(n%i==0)
            return false;
    }
    return true;
}

int gcd(int a, int b)
{
    if(b==0)
        return a;

    return gcd(b, a%b);
}

int main(){
    bool is_prime[1000000];

    is_prime[0] = is_prime[1] = false;

    for(int i=2; i<1000000; i++){
        is_prime[i] = true;
    }

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

    int n_prime[1000000];

    int cnt = 0;
    for(int i=0; i<1000000; i++){
        if(is_prime[i]){
            cnt++;
        }
        n_prime[i] = cnt;
    }

    while(1){
        int n;
        cin >> n;
        if(cin.eof()){
            break;
        }
        cout << n_prime[n] << endl;
    }
}
