#include<iostream>
#include<algorithm>
#include<set>
#include<map>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<cstdio>
#include<cstdlib>
using namespace std;
#define REP(i,a,n) for(int i = a ; i < n ; i++)
#define rep(i,n) REP(i,0,n)

typedef long long ll;

const int N = 1000000;  //MAXPRIME
const int M = 1000; //SQRT(N)
const int K = 600000;   //NUMBER OF PRIMES, CHOOSE 9/8 * N / LOG(N)

vector<int> iterativeSieve(){
  static int p[K],table[M];
  REP(i,2,M) p[i] = i;
  for(int i=2;i*i<M;i++)
    if(p[i])
      for(int j=i*i;j<M;j+=i)
        p[j] = 0;
  p[0] = p[1] = 0;

  int num = remove(p,p+M,0) - p;
  for(int m=M;m<N;m+=M){
    for(int x=m;x<m+M;x++)
      table[x-m] = x;
    for(int i=0,j;p[i]*p[i]<m+M;i++){
      if(p[i] >= m) j = p[i] * p[i];
      else if(m % p[i] == 0) j = m;
      else j = m - (m % p[i]) + p[i];
      for(;j<m+M;j+=p[i]) table[j-m] = 0;
    }
    num = remove_copy(table,table+M,p+num,0) - p;
  }
  return vector<int>(p,p+num);
}

int main(){
  vector<int> p = iterativeSieve();
  int n;
  while(cin>>n){
    cout<<upper_bound(p.begin(),p.end(),n) - p.begin()<<endl;
  }
}