#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <iomanip>
#define rep(i, n) for (int i = 0; i < (int)(n); i++
using namespace std;
const int MAX_N=int(1e8+5);
vector<bool> is_prime(MAX_N,true);

void sieve(int n) {
	fill(is_prime.begin(),is_prime.end(),true);
		is_prime[0]=false;
		is_prime[1]=false;
		for (int i = 2; i * i <= n; i++) {
			if (is_prime[i]) {
				for (int j = i * i; j <= n; j += i) is_prime[j] = false;
			}
		}
	return;
}
int main() {
	int n;
	while (cin >> n) {
		int cnt = 0;
		sieve(n);
		for (int i = 2; i <= n; i++) {
			if (is_prime[i]) {
				cnt++;
			}
		}
		cout << cnt << endl;
	}
}

