#include <math.h>
#include <iostream>
using namespace std;

int main()
{

	int n;
	while (cin >> n) {
		int C = 0;
		bool prime[1000000] = { 0 };
		// 0????´???°
		prime[1] = 1;
		prime[2] = 0;

		for (int j = 2; j * j <= n; j++) {
			if (prime[j] ==0) {
				for (int k = 2; k*j <= n; k++) {
					prime[j*k] = 1;
				}
			}
		}
		for (int i = 1; i <= n; i++) {
			if (prime[i] == 0)
				C++;
		}
		cout << C << endl;
	}
	return 0;
}