#include <iostream>
#include <cmath>
using namespace std;
int main(){
    int n;
    char prime[1000000] = {1, 1};
    for(int k = 2; k < 1000; k++){
        if(prime[k] == 0){
            for(int j = k * k; j < 1000000; j += k)
                prime[j] = 1;
        }
    }
    while(cin >> n){
        int res = 0;
        for(int j = 2; j <= n;j++) 
			if(prime[j] == 0) 
				res++;
        cout << res << endl;
    }
}