#include<iostream>
using namespace std;

int main(){
	long long int prime[999999];
	long long int ptr=0;
	
	prime[ptr++]=2;
	prime[ptr++]=3;

	for(int no = 5 ; no <=  999999 ; no += 2){
		int flag = 0;
		for (int i = 1; prime[i] * prime[i] <= no ; i++){
			if(no % prime[i] == 0){
				flag=1;
				break;
			}
		}
		if(!flag)
			prime[ptr++] = no;
	}
	
	
	int n,co=0;
	while(cin>>n){
		co=0;
		for(int i=0; prime[i] <= n ;i++){
			co++;
		}
		cout<<co <<endl;
	}
}