#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
const int MAXN = 1000000;
bool isPrime[MAXN];
int main(){
  fill(isPrime,isPrime+MAXN,true);
  isPrime[0] = isPrime[1] = false;
  isPrime[2] = true;
  for(int i = 0;i < MAXN;i++){
    if(isPrime[i]){
      for(int j = i*2;j < MAXN;j+=i){
        isPrime[j] = false;
      }
    }
  }
  vector<int> primes;
  for(int i = 0;i < MAXN;i++){
    if(isPrime[i])primes.push_back(i);
  }
  int n;

  while(cin >> n){
    auto a = upper_bound(primes.begin(),primes.end(),n);
    cout << a - primes.begin() << endl;
  }
}