#include <cstdio>
#include <cstring>

using namespace std;

bool is_prime[1000000];
int prime[1000000];

void init_prime()
{
	int n = sizeof(prime)/sizeof(prime[0]);
	int i;

	memset(is_prime, 1, sizeof(is_prime));
	is_prime[0] = is_prime[1] = false;
	prime[0] = prime[1] = 0;
	for (i=2; i<n; i++) {
		prime[i] = prime[i-1];
		if (is_prime[i]) {
			prime[i]++;
			int j;
			for (j=i+i; j<n; j+=i)
				is_prime[j] = false;

		}
	}
}

int main()
{
	//freopen("in.txt", "r", stdin);

	init_prime();
	int a;

	while (scanf("%d", &a)==1) {
		printf("%d\n", prime[a]);

	}

	return 0;
}