#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;
const int MAX_N = 1e6+5;
int prime[MAX_N];
bool is_prime[MAX_N];
int sieve(){
    memset(is_prime, true, sizeof(is_prime));
    int p = 0;
    is_prime[0] = is_prime[1] = false;
    for(int i = 2;i < MAX_N;i++){
        if(is_prime[i]){
            prime[p++] = i;
            for(int j = 2*i;j < MAX_N;j+=i){
                is_prime[j] = false;
            }
        }
    }
    return p;
}

int main(){
    int n;

    while(~scanf("%d",&n)){
            int p = sieve();
//        printf("test :\n");
//        for(int i = 0;i < 10;i++){
//            printf("%d ",prime[i]);
//        }
//        cout <<endl;
        int num = upper_bound(prime, prime + p, n) - prime;
        printf("%d\n",num);
    }
}