#include<cstdio>
//#include<cmath>
//#include<iostream>
using namespace std;

#define MAX 1000000

int main(){
	int i,j,k,n;
	bool arr[MAX];
		i=MAX; while(i--) arr[i]=true;

	while(scanf("%d", &n)!=EOF){

	for(j=2; j<=n; j++){
		if(arr[j]==true){
		for(k=2; j*k<=n; k++){
			arr[j*k]=false;
		}
		}
	}

	for(j=2, k=0; j<=n; j++) if(arr[j]==true) k++;

	printf("%d\n", k);
	}
 return 0;
}