#include<iostream>

using namespace std;

int limit(int n) {
	int i = 1;
	while (i*i <= n) {
		i += 1;
	}
	return i - 1;
}

int main() {
	int n;
	while (std::cin >> n) {
		int *array = new int[n + 1];

		for (int i = 1; i <= n; i++) {
			array[i] = 0;
		}

		int num_max,count;
		num_max = limit(n);
		count = 0;
		for (int i = 2; i <= num_max; i++) {
			if (array[i] == 0) {
				for (int j = 2 * i; j <= n; j += i) {
					if (array[j] == 0) {
						array[j] = 1;
						count += 1;
					}
				}
			}
		}
		std::cout << n - (count+1) << std::endl;
	}
}
