#include <iostream>

using namespace std;
int TestCase;



int main()
{
   while(cin >> TestCase)
   {
       int PrimeNumbers = 0;
       if(TestCase >= 2)
       {
           PrimeNumbers++;
       }
       for(int Sample = 3; Sample <= TestCase; Sample+=2)
       {
           if(Sample > 10)
           {
                if(Sample%3 != 0 && Sample%5 != 0 && Sample%7 != 0)
               {
                   PrimeNumbers++;
               }
           }
           else
           {
               if(Sample != 9)
               {
                   PrimeNumbers++;
               }
           }

       }
       cout << PrimeNumbers << endl;
   }

}