#include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <cmath>
#include <string>
#include <sstream>
#include <iomanip>
#include <complex>
using namespace std;

#define ll long long
#define vvi vector< vector<int> >
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back 
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

#define MAXINT 1000000
bool isprime[MAXINT];
ll int sum[MAXINT];
void makeprime(){
	REP(i,MAXINT) isprime[i] = true;
	FOR(i,2,sqrt(MAXINT)+1){
		FOR(j,i+1,MAXINT-1){
			if(j%i==0) isprime[j] = false;
		}
	}
}

int main(){
	makeprime();
	sum[0] = 0;
	sum[1] = 0;
	sum[2] = 1;
	/*FOR(i,3,MAXINT){
		if(isprime[i]) sum[i] = sum[i-1]+1;
		else sum[i] = sum[i-1];
	}*/
	ll int n;
	while(cin >> n){
		ll int ans = 0;
		REP(i,n) if(isprime[i]) ans++;
		cout << ans << endl;
	}
}