#include <iostream>
using namespace std;
#define MAX 10000000
int prime[MAX];

int main(){
	prime[1]=1;
	prime[2]=0;
	prime[3]=0;

	for(int i = 2;i<=MAX;i++)
		if(prime[i]==0)
			for(int j = 2 * i;j<=MAX;j+=i)
				prime[j]=1;
	
	int n;
	while(true){
	
	cin >> n;
	if(cin.eof())
		break;
		
	int num = 0;	
	for(int k=1;k<=n;k++)
		if(prime[k]==0)
			num++;

	cout << num << endl;
	}
	return 0;
}