#include <iostream>
using namespace std;

constexpr int INSUU = 64;
constexpr int SOSUU = 1000000;

int Eratosthenes(int* primes){
  primes[0] = 2;
  primes[1] = 3;
  primes[2] = 5;
  primes[3] = 7;
  int prime_p = 4;
  for(int p = 11; p <= SOSUU; p+=2){
    bool is_prime = true;
    for(int i = 0; i < prime_p && primes[i] < 1000; i++){
      if((p % primes[i]) == 0){
	is_prime = false;
	break;
      }
    }
    if(is_prime){
      primes[prime_p++] = p;
    }
  }
  return prime_p;
}
int main(){
  int primes[SOSUU/2];
  int prime_count = Eratosthenes(primes);
  int n;
  while(cin >> n){
    int i = 0;
    for(; i < prime_count; i++){
      if(n < primes[i]){
	cout << i << endl;
	break;
      }
    }
    if(prime_count == i){
      cout << prime_count << endl;
    }
  }
}