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

using namespace std;

typedef unsigned int U;

const U R = 1000000;
bool isp[R];
vector<U> primes;

void elatos(){
  memset(isp , 1 , sizeof(isp));
  U n = 0;
  for(U i=2; i < R; i++)
    if(isp[i])
      for(U j=2*i; j < R; j+=i) isp[j] = 0;
  for(U i=2; i<R; i++) if(isp[i]) primes.push_back(i);
}

int main(){
  elatos();
  int n;
  while(cin >> n){
    vector<U>::iterator it = upper_bound(primes.begin(), primes.end() , n);
    cout << it - primes.begin() << endl;
  }
  return 0;
}