#include<iostream>

int main(){
  int prime[1000000]={0};
  int number[1000000];
  int k,n;

  number[1] = 0;

  for(int i=2;i<1000000;i++){
    if(prime[i]==0){
      for(int j=2;i*j<1000000;j++){
        prime[i*j] = 1;
      }
    }
    if(prime[i]==0){
      number[i] = number[i-1] + 1;
    }else{
      number[i] = number[i-1];
    }
  }
  while(std::cin >> n){
    std::cout << number[n] << std::endl;
  }
}