#include<algorithm>
#include<iostream>
#include<string>
#include<cstdlib>
#include<cstring>
#include<cmath>
using namespace std;
int pn(int a[],int n){
  int i,j;
  a[0]=a[1]=0;
  for(i=2;i<n;i++)
    a[i]=i;
  for(i=2;i*i<n;i++){
    if(a[i]){
      for(j=i*i;j<n;j+=i)
        a[j]=0;
    }
  }
  j=2;
  for(i=0;j<n;i++){
    a[i]=a[j];
    for(j++;j<n&&a[j]==0;j++);
  }
  return i;
}
int main(){
  int i; 
  int a[1000000];
  a[pn(a,1000000)]=1000000;
  int n;
  while(cin>>n){
    for(i=0;a[i]<=n;i++);
    cout<<i<<endl;
  }
  return 0;
}