#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;


void initialize(vector<int> &search_list, int num);

void era(vector<int> &search_list, vector<int> &prime_list, int num);
  

int main(int argc, char* argv[]){
  
  int num;

  while (cin >> num){
    if (num == 1){
      cout << 0 << endl;
    }
    else{
      vector<int> search_list, prime_list;
      initialize(search_list, num);
      era(search_list, prime_list, num);
      cout << prime_list.size() << endl;
    }
  }
  return 0;
}

void initialize(vector<int> &search_list, int num){
  for (int i=2; i<=num; ++i){
    search_list.push_back(i);
  }
  return;
}

void era(vector<int> &search_list, vector<int> &prime_list, int num){
  do{
    vector<int>::iterator it = search_list.begin();
    int count = 1;
    int N = *it;
    prime_list.push_back(*it);
    while ((N*count) <= num){
      it = find(search_list.begin(), search_list.end(), (N*count));
      if (it != search_list.end()){
	it = search_list.erase(it);
      }
      ++count;
    }
  } while (!search_list.empty());
}