#include <stdio.h>

#define MAX (1000000)

bool primeTbl[MAX];

int main() {
	
	primeTbl[0] = primeTbl[1] = true;
	for(int i=2; i<MAX; i++) {
		if(!primeTbl[i])
			for(int j=i*2; j<MAX; j+=i)
				primeTbl[j] = true;
	}

	int n;
	while(scanf(" %d", &n)) {
		int ans = 0;
		for(int i=2; i<=n; i++)
			if(!primeTbl[i])
				ans++;
		printf("%d\n", ans);
	}
	return 0;
}