#include <stdio.h>

#define MAX (999999)

int main(void)
{
	int i, j;
	bool p[MAX + 1] = {true};
	// ツェツ素ツ青板表ツ催ャツ青ャツづ可使ツづつスツェ
	int n, ans;
	
	// ツつアツづつゥツづァツ素ツ青板表ツ催ャツ青ャ
	p[0] = p[1] = true;
	for (int i = 2; (i * i) <= MAX; i++){
		if (p[i]){
			for (int j = 2; i * j <= MAX; j++){
				p[i * j] = false;
			}
		}
	}
	// ツつアツつアツづ慊づ！
	
	// ツ本ツ氾板つ「ツづつュツづヲツー
	while (scanf("%d", &n) != EOF){
		ans = 0;
		for (i = 0; i < n; i++){
			if (p[i]){
				ans++;
//				printf("%d:", i);
			}
		}
		printf("%d\n", ans);
	}
	
	return (0);
}