#include<iostream>
#include<cmath>
#include<vector>
#define N 999999

using namespace std;

int main(){
  int i, j, n, isFound, count;
  vector<int> data;

  data.push_back(2);
  data.push_back(3);
  for(i=5; i<=N; i+=2){
    for(j=1, isFound=0; data[j]<=sqrt(i); ++j){
      if(i%data[j] == 0){
	isFound = 1;
	break;
      }
    }
    if(isFound == 0) data.push_back(i);
  }

  while(cin >> n){
    for(i=0; i<data.size(); ++i){
      if(n < data[i]) break;
    }
    cout << i << endl;
  }

  return 0;
}