#include <iostream>
#include <cmath>
using namespace std;

int a[1000000];

int sosuu(){
	a[0] = 0;
	a[1] = 0; 
	int k;
	for(int i = 2;i<1000000;i++){
		k = 0;
		a[i] = a[i - 1];
		for(int j=2;j<=sqrt(i);j++){
			if(i%j == 0){
				k++;
				break;
			}
		}
		if(k==0){
			a[i]++;
		}
	}
	return 0;

}

int main(){
	int n;
	sosuu();
	while (true)
	{
		cin >> n;
		if (cin.eof()) { break; }
		cout << a[n] << endl;
	}
	return 0;
}