#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main(void)
{
	int num, cnt;
	unsigned int i, j;
	int data_num;
	unsigned int sq_num;
	unsigned int *prime;

	scanf("%d", &num);

	sq_num = (int)sqrt((double)num);
	prime = (unsigned int*)malloc(sizeof(unsigned int) * num);

	for (i = 0; i < num; i++) {
		prime[i] = 1;
	}

	prime[0] = 0;
	for (i = 1; i < sq_num; i++) {
		if (prime[i] == 1) {
			for (j = (i+1); (i+1) * j <= num; j++) {
			prime[(i+1) * j - 1] = 0;
			}
		}
	}

	cnt = 0;
	for (i = 0; i < num; i++) {
		if (prime[i] == 1) {
			cnt++;
			//printf("%d", i + 1);
		}
	}

	printf("%d\n", cnt);

	free(prime);

	return 0;

}