#include <iostream>

using namespace std;

#define NMAX 1000001
bool p[NMAX];
int c, cnt[NMAX];
void show(){
  for(int i = 0; i < 20; i++){
    cout << "@" << i << ":" << p[i] << endl;
  }
}
void prime(){
  fill(p, p+NMAX, true);
  p[0] = p[1] = false;
  for(int i = 4; i < NMAX; i+=2)p[i] = false;
  for(int i = 3; i*i < NMAX; i+=2){
    if(p[i]){
      for(int j = i+i; j < NMAX; j+=i){
	p[j] = false;
      }
    }
  }
  for(int i = 0; i < NMAX; i++){
    if(p[i])c++;
    cnt[i] = c;
  }
}
int main(){
  prime();
  int n;
  while(cin >> n){
    cout << cnt[n] << endl;
  }
  return 0;
}