#include<bits/stdc++.h>
using namespace std;
 
#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define SORT(c) sort((c).begin(),(c).end())
#define IINF INT_MAX
#define LLINF LLONG_MAX
#define DEBUG false
 
typedef long long ll;
typedef pair<int, int> ii;

int main(){

	vector<bool> used(1000000);
	set<ll> prime;
	
	REP(i, 2, 1000000){
		if(!used[i]) prime.insert(i);
		for(int j = 1; i * j < 1000000; j++){
			used[i*j] = true;
		}
	}
	
	int n;
	while(cin >> n){
		auto it = upper_bound(prime.begin(), prime.end(), n);
		cout << distance(prime.begin(), it) << endl;
	}
	
	
	return 0;
}