#include <stdio.h>

int main(void){
	bool a[1000000];
	int n = 0;
	int c = 0;
	while(scanf("%d", &n) != EOF){
		switch(n){
		case 1:
			c = 0;
			break;
		case 2:
			c = 1;
			break;
		default:
			c = 2;
			for(int i=3; i<=n/2; i+=2){
				a[i] = true;
			}
			for(int i=3; i<=n/2; i+=2){
				if(a[i] == false){ continue; }
				c++;
				for(int j=i; j<=n; j+=i){
					a[j] = false;
				}
			}
			break;
		}
		printf("%d\n", c);
	}
	return 0;
}