#include <iostream>
using namespace std;
bool isPrime[1000000];
void calcPrime(){
  fill(isPrime, isPrime+1000000, true);
  isPrime[0] = isPrime[1] = false;

  for(int i = 4; i < 1000000; i+=2){
    isPrime[i] = false;
  }
  
  for(int i = 3; i*i < 1000000; i+=2){
    if(isPrime[i] == false)continue;
    for(int j = i+i; j < 1000000; j+=i){
      isPrime[j] = false;
    }
  }
}
int main(){
  calcPrime();
  int n;
  while(cin >> n){
    int cnt = 0;
    for(int i = 2; i <= n; i++){
      if(isPrime[i])cnt++;
    }
    cout << cnt << endl;
  }
  return 0;
}