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

int main() {
	
	int n;
	int count;
	int prime[999999];
	int max=0;
	
	
	while( cin >> n ){
		if(n > max){
		
			count = 1;
			prime[0] = 2;
			for(int i=3;i<=n;i+=2){
				int isPrime = true;
			
				for(int j=0;j<count;++j){
					if(i%prime[j] == 0){isPrime = false;break;}
				}
				if(isPrime){
					prime[count] = i;
					count++;
				}
			}
			max = n;
		}else{
			count = 0;
			for(int i=0;i<999999;++i){
				if(prime[i] > n)break;
				count++;
			}
		}
		cout << count << endl;
		
	}
	return 0;
}