题目分析:本题中的数字范围太大了,不能用平时我们所提及的欧拉筛法或者是埃斯托尼筛法。。

本体使用的是素数定理的位数公式



/*
 * nefu117.cpp
 *
 *  Created on: 2014年4月11日
 *      Author: pc
 */

#include <iostream>
#include <cstdio>
#include <cmath>

using namespace std;

/**
 * 素数定理的位数公式
 * 此函数用于求小于10^n的素数的个数的为数
 */
double shusudingli(int n){
	return n-log10(n)-log10(log(10));
}

int main(){

	int n;
	int result;
	while(scanf("%d",&n)!=EOF){
	     result = (int)shusudingli(n);
	     printf("%d\n",result+1);
	}

	return 0;

}