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

using namespace std;
#define MAX_NUM 999999

int main(){
  int n;
  bool flag = false;
  int numPrime[MAX_NUM];
  int pivot = 1;
  
  while(cin >> n){

    if(n < pivot){
      cout << numPrime[n] << endl;
      continue;
    }
    
    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;
      }
    }
    cout << numPrime[n] << endl;
  }
}