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

#define MAX 1000000

int prime[MAX]={};

void eratos(void){
	int i,j;
	prime[0] = 1;
	prime[1] = 1;
	for(i = 2;i < MAX/2;i++){
		for(j = 2;i*j <= MAX;j++){
			prime[i*j] = 1;
		}
	}
}

int main(void){
	long i,j;
	long n;
	int cnt;
	int prime_cnt;

	eratos();
	while(scanf("%ld",&n) != EOF){
		prime_cnt = 0;
		for(i = 0;i <= n;i++){
			if(prime[i] == 0)
				prime_cnt++;
		}
		/*prime_cnt = 0;
		for(i = 0;i < n+1;i++){
			cnt = 0;
			if(i < 2) continue;
			if(i == 2){
				prime_cnt++;
				continue;
			}
			for(j = 2;j <= i/2;j++){
				if(i % j == 0){
					cnt++;
					break;
				}
			}
			if(cnt == 0) prime_cnt++;
		}
		printf("%d\n",prime_cnt);*/		
		printf("%d\n",prime_cnt);
	}
	return 0;
}