
#include<iostream>
#pragma warning(disable:4996)
using namespace std;
int n,t;
int d[10000000];
bool is_prime(int n){
	for (int i = 2; i*i <= n; i++)
	if (n%i == 0)   return false;   return true;

}
int main(){
	for (int i = 0; i < 10000000; i++)
		d[i] = 1;
	for (int i = 2; i<100; i++){
		if (is_prime(i))
		{
			int j = 2;
			while (i*j < 10000000){
			     d[i*j] = 0;
				j++;
			}
		}}
	while (scanf("%d", &n) != EOF){
		t = 0;
		for (int i = 2; i <= n; i++){
			if (d[i] == 1)
				t++;
		}
		cout << t << endl;

	}


}