#include<iostream>
using namespace std;
int main(){
  long n;
  int count1,count2;
  while(1){
    cin >>n;
    count2=0;
    for(int i=n;i>1;i--){
      count1=0;
      for(int j=2;j<i;j++){
	if(i%j==0){
	  count1++;
	  break;}
      }
      if(count1==0)count2++;}
      cout <<count2<<endl;
    }
  return 0;
}
     