#include<iostream>
#include<map>
#define M 999999
using namespace std;
int Prime[999999];
void sang()
{
for(long i=3;i<=M;i+=2) Prime[i]=1;
Prime[0]=Prime[1]=0;
Prime[2]=1;
for(long i=2;i<=M/i;i++)
if(Prime[i]==1)
{
for(long j=i*i;j<=M;j+=i) Prime[j]=0;
}
for(long long i=0;i<=M;i++){
			Prime[i]+=Prime[i-1];
	    }
}
int main()
{
	sang();
	long long n;
	while(1){
		cin>>n;
	    cout<<Prime[n]<<endl;
	}
    return 0;
}