#include <iostream> 
#include <math.h>
using namespace std; 

int main(void) { 
	int A[1000000];
	for(int i = 0; i < 1000000; i++){
		A[i] = 1;
	}
	A[0] = A[1] = 0;
	for(int i = 2; i < sqrt(1000000); i++){
	    if(A[i] == 1){
    		for(int j = 2; i * j < 1000000; j++){
                	A[i * j] = 0;
		    }
	    }
	}
	int n;
	while(cin >> n){ 
		int COUNT = 0;
		for(int i = 1; i <= n; i++){
            COUNT += A[i];
		}
		cout << COUNT << endl;
	}
	return 0; 
} 
