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

vector<int>memo;

bool isprime(int q){
	if(q==2){
		return true;
	}else if(q%2==0){
		return false;
	}else{
		int max=sqrt(q);
		for(int i=3;i<q;i=i+2){
			if(q%i==0)return false;
		}
		return true;
	}
}

int main(){
	int n;
	while(cin>>n){
		if(n+1>memo.size())memo.resize(n+1);
		int sum=0;
		for(int i=2;i<=n;i++){
			if(memo[i]==1){
				sum++;
				continue;
			}else if(memo[i]==-1){
				continue;
			}else if(isprime(i)){
				sum++;
				memo[i]=1;
			}else{
				memo[i]=-1;
			}
		}
		cout<<sum<<endl;
	}
	return 0;
}