#include <iostream>
#include <iomanip>
#include <cmath>


using namespace std;
#define MAX_NUM 999999


//int do_count(bool *isPrime, int n);

int main(){
  int n;
  bool flag = false;
  int numPrime[MAX_NUM];
  int pivot = 1;
  
  //  for(int i=0;i<MAX_NUM;i++){
  //numPrime[i] = 0;
  //  }
  
  while(cin >> n){
    int cnt=0;
    if(n < pivot){
      //      cout << "n < pivot" << endl;
      cnt = numPrime[n];
      cout << cnt << endl;
      continue;
      
    }
    
    //    if(n >= pivot){
    //  }
    
    for(int i=pivot+1;i<=n;i++){
      flag = false;
      //?´???°?????????????????§??????
      for(int j=2;j<=sqrt(i);j++){
	if(i%j==0){
	  flag = true;
	  break;
	}
      }
      if(flag){
	numPrime[i] = numPrime[i-1];
	continue;
      }else{
	numPrime[i] = numPrime[i-1] + 1;
      }
    }
    cnt = numPrime[n];
    cout << cnt << endl;
  }
}