#include <iostream>
#include <cmath>
#define	NUM		1000000
using namespace std;

bool sosuu[NUM+1] = {false};
int t = 0;
int out[30];

void Prime(int a)
{
	int count = 0;
	int x;
	x = floor(sqrt(a));
	for(int i = 2; i < x+1; i++){
		if(sosuu[i] == true){
			continue;
		}
		for(int j = 2*i; j < a+1; j = j+i){
			sosuu[j] = true;
		}
	}
	for(int i = 2; i < a+1; i++){
		if(sosuu[i] == false){
			count++;
		}
	}
	out[t] = count;
}

int main()
{
	int n;
	while(cin >> n){
		Prime(n);
		t++;
	}
	for(int i = 0; i < t; i++){
		cout << out[i] << endl;
	}
}