#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;
typedef long long lint;

int idx;
int prime[5761455];
bool sieve[10002];
bool sieveBig[1000002];

void segmentSieve(lint a, lint b)
{
	memset(sieveBig, 0, sizeof(sieveBig));
	if (a == 1) sieveBig[0] = true;
	for (int i = 2; (lint)i * i < b; i++){
		if (sieve[i]){
			for (int j = max(2ll, (a + i - 1) / i) * i; (lint)j < b; j += i) sieveBig[j - a] = true;
		}
	}
	
	for (int i = 0; i < b - a; i++){
		if (!sieveBig[i]){
			prime[idx++] = (lint)i + a;
		}
	}
}

int main()
{
	for (int i = 3; i <= 10000; i += 2) sieve[i] = true;
	sieve[2] = true;
	
	for (int i = 3; i <= 10000; i += 2){
		if (sieve[i]){
			for (int j = i * 3; j <= 10000; j += 2 * i) sieve[j] = false;
		}
	}
	
	for (int i = 0; i < 100; i++) segmentSieve(1000000 * i + 1, 1000000 * (i + 1) + 1);
	
	
	//int N;
	//scanf("%d", &N);
	
	//for (int i = 0; i < N; i++){
		int a, b;
		while (scanf("%d", &b) == 1){
		    int *low = upper_bound(prime, prime + 5761455, 0) - 1, *up = upper_bound(prime, prime + 5761455, b) - 1;
		    printf("%d\n", up - low);
                }
	//}
	
	
	return (0);
}