#include <iostream>
using namespace std;

int main(){
  int a,j,cou;
  while(cin>>a){
    cou=0;
    for(int i=2;i<=a;i++){
      if(i==2){
	cou++;
	continue;
      }
      else if(i%2==0)continue;
      for(j=3;j*j<=i;j+=2)if(i%j==0)break;
      if(j*j>i)cou++;
    }
    cout <<cou<<endl;
  }
  return 0;
}
	