#include<iostream>
using namespace std;
// n < 1000000

int is_it_primeNum(int n)
{
	int a = 1;
	if (n == 0 || n == 1)
		return 0;
	else if (n == 2)
		return 1;
	else if(n % 2 == 0)
		return 0;
	else{ 
		for(int i=3;i<n/2;i+=2){
			if (n%i==0){
				a = 0;
				break;}
		}
	}
	return a;
}
int how_much_primeNum(int n)
{
	int ans = 0;
	for(int i=2;i<=n;i++){
		ans += is_it_primeNum(i);
	}
	return ans;
}

int main()
{
	int n;
	while(cin>>n)
		cout << how_much_primeNum(n) << endl;
	return 0;
}
				