import std.conv,
			 std.stdio,
			 std.string,
			 std.algorithm;

int xs[];
int get_numberof_primenumbers (int n) {
	if (n <= 1) return 0;

	int cnt = 0;

	xs = new int[n+1];
	fill(xs, true);

	foreach (int i; 2..n+1) {
		if (xs[i]) {
			++cnt;
			int j = i;
			while (n >= j) {
				xs[j] = false;
				j += i;
			}
		}
	}

	return cnt;
}

void main() {
	while (true) {
		string s = readln;
		if (stdin.eof()) break;
	int n = s.chomp.to!int;
	writefln("%d", get_numberof_primenumbers(n));
	}
	return;
}