#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include <functional>
#include <iomanip>
using namespace std;

#define ll long long int

#define rep(p,q) for(int i = p; i < q;i++)


void eratos(bool isPrime[10000000]) {
	
	rep(0, 10000000)isPrime[i] = true;
	rep(2, 10000000) {
		if (!isPrime[i])continue;
		else {
			for (int j = i * 2; j < 10000000; j += i) {
				isPrime[j] = false;
			}
		}
	}
}

//9

int main(void) {
	static bool isPrime[10000000];
	eratos(isPrime);
	static int countPrime[10000000];
	countPrime[0] = 0;
	countPrime[1] = 0;
	rep(2, 10000000) {
		if (isPrime[i])countPrime[i] = countPrime[i - 1] + 1;
		else countPrime[i] = countPrime[i - 1];
	}
	int n;
	while (cin >> n) {
		cout << countPrime[n] << endl;
	}

}
