#include<iostream>
#include<cstring>
#include<cmath>
using namespace std;

int main(void){
  int n;
  short int p[1000000];
  p[0] = p[1] = 0;
  p[2] = 1;
  int ans = 0;
  bool flag;
  for(int i = 3; i <= 1000000; i ++){
    if(i % 2 != 0){
      flag = true;
      for(int j = 3; j * j <= i; j += 2){
	if(i % j == 0){
	  flag = false;
	}
      }
      if(flag)
	ans++;
    }
    p[i] = ans;
  }
  // cout << "end" << endl;
  while(cin >> n){
    cout << p[n] << endl;
  }
  return 0;
}