#include <iostream>
 
int main(){
    int n, count;
    while(std::cin >> n){
        count = 0;
        for(int i=3; i<=n; i++){            // check whether i is a prime number greater than 3
            for(int j=2; j<i; j++){         // judge from whether j is an i's divisor
                if(i % j == 0)              // if j is an i's divisor
                    break;                  // exit the j-loop & start to check suc(i)
                if(j == i - 1)              // when the j-loop lasts until i-1
                    count++;                // j is a prime!
            }
        }
        if(n>=2)
            count++;                        // 2 is also a prime
        std::cout << count << std::endl;
    }
    return 0;
}