#include<iostream>
#define MAX 1000000
using namespace std;

class prime{
	int sum;
	char p[MAX];
public:
	prime();
	int num(int n);
};

prime::prime(){
	p[0]=0;
	p[1]=0;
	p[2]=1;
	for(int i=3;i<MAX;i+=2)p[i]=1;
	for(int i=4;i<MAX;i+=2)p[i]=0;
	
	int c=3;
	while(c<1000){
		for(int i=c+2;i<MAX;i+=2){
			if(i%c==0)p[i]=0;
		}
		while(p[++c]==0);
	}
}

int prime::num(int n){
	sum=0;
	for(int i=0;i<=n;i++)sum+=p[i];
	return sum;
}

int main()
{
	int n;
	prime pr;
	while(cin >> n){
		cout << pr.num(n) << endl;
	}
	return 0;
}