#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=0;
	int tmp[3][100];
	int k=0,max=0;
	while(cin>>n){
		tmp[0][k++]=n;
		if(max<n) max = n;
		if(n==1){
			tmp[1][k-1]=0;
		}
		else if(n==2){
			tmp[1][k-1]=1;
		}
		else if(n==3){
			tmp[1][k-1]=2;
		}
	}
	//cout<<"hoge\n";
	prime.push_back(2);
	prime.push_back(3);
	//count[1]=0;
	//count[2]=1;
	//count[3]=2;
	//cout<<"hoge\n";
	count = 2;
	for(int i=4;i<max+1;i++){
		/*if(i%2==0){
			count[i]=prime.size();
		}
		else if(i%3==0){
			count[i]=prime.size();
		}
		else{
			*/
			count++;
			prime.push_back(i);
			for(int j=0;j<prime.size()-1;j++){
				if(i%prime[j]==0){
					count--;
					prime.pop_back();
					break;
				}
			}
			for(int j=0;j<k;j++){
				if(tmp[0][j]==i){
					tmp[1][j]=count;
				}
			}
		//}
	}
	//cout<<"hoge";
	/*for(int i=0;i<15;i++){
		cout<< count[i] << endl;
	}*/
	for(int j=0;j<k;j++){
		cout<<tmp[1][j]<<endl;
	}
	return 0;
}