#include <iostream>
using namespace std;

int main(int argc, const char * argv[])
{
    int count=0;
    int i=1;
    int n=1;
    int number;
    // insert code here...
    while (cin >> number, number != EOF){
        while (n <= number){
            if(n == 1) {n++; continue;}
            while (i <= n) {
                if(i == 1) {i++; continue;}
                if(i == n) count++;
                if(n % i == 0) break;
                i++;
            }
            n++;
            i=1;
        }
        i=1;
        n=1;
        cout << count << endl;
        count = 0;
    }
    
    return 0;
}