#include <iostream>
#include <algorithm>
#include <cstdio>
#include <string>

using namespace std;

int main() {

	int n, count = 0;
	int a[9999] = { 0 };
	
	// ??¨???????????????????????????

	while (cin >> n){

		for (int i = 2; i <= n; i++) {
			a[i] = 1;
		}

		for (int i = 2; i < sqrt(n); i++) {
			if (a[i]) {
				for (int j = 0; i*(j + 2) <= n; j++) {
					a[i * (j + 2)] = 0;
				}
			}
		}

		for (int i = 2; i <= n; i++) {
			if (a[i] == 1)
				count++;
		}

		cout << count << endl;
		count = 0;
	}

	return 0;
}