#include <iostream>
#include <algorithm>
#include <string>
using namespace std;

const int M = 110000;

bool p[M];
int prime_n[M];

void prime() {
  fill(p, p+M, true);
  p[0] = p[1] = false;
  for(int i = 2; i*i < M; i++) {
    if(p[i]) {
      for(int j = 2; i*j < M; j++) {
        p[i*j] = false;
      }
    }
  }

  int count = 0;
  for(int i = 2; i < M; i++) {
    if(p[i]) prime_n[i] = ++count;
    else prime_n[i] = count;
  }
}

int main() {
  prime();
  
  int n;
  while(cin >> n) {
    cout << prime_n[n] << endl;
  }
}