#include<iostream>
using namespace std;

bool arr[1000000] = {};

void sieve(){
	for(int i = 2; i < 1000000; i++){
		if(arr[i])
			continue;
		for(int j = i*2; j < 1000000; j+=i)
			arr[j] = true;
	}
}

int check(int n){
	int counter = 0;
	for(int i = 2; i <= n; i++)
		if(!arr[i])
			counter++;
	return counter;
}

int main(){
	sieve();
	int a;
	while(cin >> a){
		cout << check(a) << endl;
	}
}
