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

int main(){
    int max = 1000000;
    vector<int> prime(max, 1);
    //ツエツδ可トツスツテツネツスツづ個づ督づゥツつ「
    
    for(int i = 0; i < max; i++){
        prime[i] = 1;
    }
    prime[0] = prime[1] = 0;
    for(int i = 2; i <= max; i++){
        if(prime[i] == 1){
            for(int j=i+i; j <= max; j+=i){
                prime[j] = 0;
            }        
        }
    }
    int n;
    while(cin >> n){
        int ans = 0;
        for(int i=0; i <= n; i++){
            if(prime[i] == 1){
                ans++;
            }
        }
        cout << ans << endl;
    }
    return 0;
}