#include <iostream>
#include <queue>
#include <stack>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <string.h>
#include <string>
using namespace std;

int main(){
	int n;
	vector<int> prime;
	int count[100002];
	
	//cout<<"hoge\n";
	prime.push_back(2);
	prime.push_back(3);
	count[1]=0;
	count[2]=1;
	count[3]=2;
	//cout<<"hoge\n";
	for(int i=4;i<10000;i++){
		if(i%2==0){
			count[i]=prime.size();
		}
		else if(i%3==0){
			count[i]=prime.size();
		}
		else{
			count[i]=prime.size()+1;
			prime.push_back(i);
			for(int j=0;j<prime.size()-1;j++){
				if(i%prime[j]==0){
					count[i]--;
					prime.pop_back();
					break;
				}
			}
		}
	}
	//cout<<"hoge";
	/*for(int i=0;i<15;i++){
		cout<< count[i] << endl;
	}*/
	while(cin>>n){
		cout<<count[n]<<endl;
	}
	return 0;
}