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

bool isPrime(int n){
	double sqrtN = sqrt(n);
	for(int i = 3; i <= sqrtN; i += 2){
		if(!(n%i))
			return false;
	}
	return true;
}
 
int main(){
  bool prime[999999] = {};
  prime[1] = true;
  for(int i = 3; i < 999999; i += 2){
  	if(isPrime(i))
  		prime[i-1] = true;
  }
  int n;
  while(cin >> n){
  	int count = 0;
  	if(n >= 2)
  		count++;
    for(int i = 3; i <= n; i += 2){
    	if(prime[i-1])
    		count++;
    }
    cout << count << endl;
  }
}
