#include<iostream>
#include<cstdio>
using namespace std;

class SOSU{
   public:
      int sosu(int);
};
int SOSU::sosu(int n){
   int i,j,ans=0,flag;
   
   for(i=0;i<=n;i++){
      if(i<2)
         continue;
      
      else if(i==2 || i==3){
         ans++;
         continue;
      }
      
      if(i%2==0 || i%3==0)
         continue;
      
      flag = 0;
      for(j=2;j*j<=i;j++){
         if(i%j==0){
            flag++;
            break;
         }
      }
      if(flag==0)
         ans++;
   }
   return ans;
}

int main(){
   SOSU Sosu;
   int n,ans;
   while(cin>>n){
      ans = Sosu.sosu(n);
      printf("%d\n",ans);
   }
   return 0;
}