#include<iostream>
#include<vector>
#include<cmath>
#include<map>
#include<cstdio>
using namespace std;
#define rep(i,a) for(int i = 0 ; i < a; i ++)
#define loop(i,b,a) for(int i = b ; i < a; i ++)
const int MAX = (1e8);
bool p[MAX];
short num[MAX];
void isPrime(){
  rep(i,MAX)p[i] = true;
  p[0] = p[1] = false;
  num[0] = num[1] = 0;
  loop(i,2,MAX){
    num[i] = num[i-1] + p[i];
    if(p[i]){
      for(int j = i + i ; j < MAX ; j += i){
	p[j] = false;
      }
    }
  }
}

int main(void){
  isPrime();
  int n;
  while(cin>>n)cout<<num[n]<<endl;
  
  return 0;
}