#include <iostream>
#include <cmath>
using namespace std;

int main(){
    int n, cnt;
    bool prime[1000000] = {false, false};

    for(int i = 2;i < 1000000;i++){
        prime[i] = true;
    }
    
    for(int i = 2;i <= sqrt(1000000);i++){
        if(prime[i]){
            for(int j = 2*i;j <= 1000000;j++){
                if(j%i == 0){
                    prime[j] = false;
                }
            }
        }
    }
    
    while(cin >> n){
        cnt = 0;

        for(int i = 2;i <= n;i++){
            if(prime[i]){
                cnt++;
            }
        }
        
        cout << cnt << endl;
    }

    return 0;
}