#include <iostream>

int main() {
	int n;

	/**
	 * 0: No data
	 * 1: Prime number
	 * 2: Non prime number
	 */
	int db[1000000] = {2, 2, 1, 1};

	while (std::cin >> n) {
		int primes = 0; // n以下の素数の数
		int now;

		/* dbを走査 */
		loop:
		for (int i = 0; i <= n; i++)
		switch (db[i]) {
			case 1:
				primes++;
				break;
			case 0:
				now = i;
				goto next_phase;
		}

next_phase:
	/* 足りてなければ必要なだけごにょごにょ */
		for (int j = now; j <= n; j++) {
			bool flag = false; // はずれの目印
			for (int k = 2; k < j; k++)
				if (!(j % k)) {
					flag = true;
					break;
				}
			if (!flag) {
				db[j] = 1;
				primes++;
			} else
				db[j] = 2;
		}
		std::cout << primes << std::endl;
	}
}