#include<iostream>
#include<sstream>
#include<cstdio>
#include<fstream>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<algorithm>
#include<cmath>
#include<cstdlib>
#include<string>
using namespace std;
#define N 1000002
bool is_prime(int n){
	if(n<=1)return false;
	if(n==2)return true;
	if(!(n&1))return false;
	for(int x=3;x<=sqrt(n);x+=2) if(!(n%x))return false;
	return true;
}

int main(){
	int n;
	int primes[N];
	primes[0] = primes[1] = 0;
	int cnt = 1;
	primes[2] = cnt;
	for(int x=3;x<=N;++x){
		if(is_prime(x)){
			++cnt;
		}
		primes[x] = cnt;
	}
	while(scanf("%d",&n)==1){
		cout<<primes[n]<<endl;
	}
	return 0;
}