#include <stdio.h>
#include <iostream>
#include <vector>
#define LIMIT 1000000

int main(){
	int num;
	while( scanf("%d",&num)!=EOF ){
		bool sosu[LIMIT]={0};
		int now=2,count=0;
		while(now<=num){
			if(!sosu[now]){
				count++;
				for(int i=now;i<LIMIT;i+=now){
					sosu[i] = true;
				}
			}
			now++;
		}
		std::cout << count << std::endl;
	}
	return 0;
}