#include<iostream>

int main(){

	bool data[100001];

	for (int i = 0; i < 100001; i++)
		if (i!=2&&i % 2 == 0)
			data[i] = false;
		else
			data[i] = true;

	int in;

	for(int i=2;i<=100000;i++){
		if (i==2||i % 2 != 0) {
			for (int j = 2; j < i; j++) {
				if (i%j == 0) {
					data[i] = false;
					goto fl;
				}
			}
		}
	fl:;
	}

	while (true) {

		std::cin >> in;

		int res = 0;

		for (int i = 2; i <= in; i++) {
			if (data[i] == true)
				res++;
		}

		std::cout << res << std::endl;

	}

		return 0;
}