#include<stdio.h>
#include<math.h>
int main(void) {
	int prime[1000000] = { 0 }, n, sum = 0;;
	prime[1] = 1;
	while (scanf("%d", &n) != EOF) {
		for (size_t i = 2; i <= sqrt(n); i++)
		{
			if (prime[i] == 0)
			{
				for (size_t t = i + 1; t <= n; t++)
				{
					if (t%i == 0)prime[t] = 1;
				}
			}
		}
		for (size_t i = 2; i <= n; i++)
		{
			if (prime[i] == 0)sum++;
		}
		printf("%d\n", sum);
		sum = 0;
	}
	return 0;
}