#include<iostream>
#include<vector>

using namespace std;

#define MAX 1000000

int main(void){

  int n,count = 0,num = 0;

  while(cin >> n){

    vector<int>array(MAX,0);

    if(n == 1){
      count = 0;
      cout << count << endl;
    }

    if(n == 2){
      count = 1;
      cout << count << endl;
    }

    if(n == 3){
      count = 2;
      cout << count << endl;
    }

    if(n > 3){
      count = 2;
      num = 0;
      array[num++] = 2; 
      array[num++] = 3; 


      for(int i = 5; i <= n ; i+=2){
        int flag = 0;
        for(int j = 0; array[j] * array[j] <= i;j++){
          if(i % array[j] == 0){
            flag = 1;
            break;
          }
        }
        if(!flag){
          array[num++] = i;
          count++;
        }
      }
      cout << count << endl;
      count = 0;
      num = 0;
    }
  }

  return 0;
}