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

int is_prime(int);

int main()
{
	int input_count;
	int prime_count;
	int input;
	int for_cnt;
	int output[30];
	
	
	input_count = 0;
	
	while(scanf("%d", &input) != EOF && input_count < 30)
	{
		prime_count = 0;
		
		if(input >= 2)
		{
			prime_count++;
		}
		for_cnt = 3;
		while(for_cnt <= input)
		{
			if(is_prime(for_cnt))
			{
				prime_count++;
			}
			for_cnt += 2;
		}
		output[input_count] = prime_count;
		input_count++;
	}
	
	for(for_cnt = 0; for_cnt < input_count; for_cnt++)
	{
		printf("%d\n", output[for_cnt]);
	}
	
    return 0;
}

int is_prime(int test_num)
{
	int divisor;
	
	if(test_num == 1)
	{
		return 0;
	}
	else if(test_num == 2 || test_num == 3 || test_num == 5 || test_num == 7)
	{
		return 1;
	}
	
	else if((test_num % 2) == 0)
	{
		return 0;
	}

	for(divisor = 3 ; divisor <= (sqrt(test_num) + 1); divisor += 2)
	{
		if(test_num % divisor == 0)
		{
			return 0;
		}
	}
	
	return 1;
}