#include <iostream>
using namespace std;

int main() {
    long in, out;
    int p, count;
    
    do{
         cin >> in;
         out = 0; 
         
         for(int i = 1; i <= in; i++)
         {
                 count = 0;
                 for(p = 1; p <= i; p++)
                 {
                       if(i % p == 0){
                            count++;
                            }
                 }
                 
                 if(count == 2){
                          out++;
                 }
         }
         
         cout << out << endl;
         
    }while(in);  
    

    return 0;
}