#include <iostream>
int a[1000000];
bool tf[1000000];
void f(){
    for(int i = 0;i < 1000000;i++){
        tf[i] = true;
    }
    tf[0] = tf[1] = false;
    for(int i = 2;i < 1000000;i++){
        if(tf[i]){
            for(int j = 2 * i;j < 1000000;j += i){
                tf[j] = false;
            }
        }
    }
    int sum = 0;
    for(int i = 1;i < 1000000;i++){
        sum = (tf[i] == true)? sum + 1 : sum;
        a[i] = sum;
    }
}
int main(){
    f();
    int x;
    while(std::cin >> x){
        std::cout << a[x] << "\n";
    }
    return 0;
}
