#include<bits/stdc++.h>
using namespace std;
#define all(vec) vec.begin(),vec.end()
typedef long long int ll;
typedef pair<ll,ll> P;
const ll MOD=1234567;
const ll INF=1000000010;
const ll LINF=1000000000000000010LL;
const int MAX=10000010;
const double EPS=1e-3;
int dx[4]={0,1,0,1};
int dy[4]={0,0,1,1};
int prime[MAX];		
void erast(){
	prime[0]=0;prime[1]=0;
	for(int i=2;i<MAX;i++){
   		prime[i]=1;
	}
	for(int i=2;i<=MAX/2;i++){
    	if(prime[i]==1){
        	for(int j=i+i;j<=MAX;j+=i){
            	prime[j]=0;
        	}
    	}
	}
}
int main(){
	int n;
	erast();
	while(cin>>n){
		int ans=0;
		for(int i=1;i<=n;i++){
			if(prime[i]){
				ans++;
			}
		}
		cout<<ans<<endl;
	}
	return 0;
}

