#include <bits/stdc++.h>
//#include "bits/stdc++.h"

#define rep(i,n) for(ll (i)=0;(i)<(ll)(n);(i)++)
#define all(x) (x).begin(),(x).end()
#define MOD 1000000007LL
#define INF (1LL<<60LL)
#define int long long
typedef long long ll;

using namespace std;

#define MAX_N 1000000

signed main() {
	vector<bool> is_prime(MAX_N,true);
	is_prime[1] = false;
	for (ll i = 2; i <= sqrt(MAX_N); i++) {
		if (is_prime[i]) {
			ll k =2*i;
			while (k < MAX_N) {
				is_prime[k] = false;
				k += i;
			}
		}
	}
	vector<ll> ans(MAX_N, 0);
	for (ll i = 1; i < MAX_N; i++) {
		ans[i] = ans[i - 1];
		if (is_prime[i]) ans[i]++;
	}
	ll n;
	while (cin >> n) {
		cout << ans[n] << endl;
	}
}
