#include <iostream>

int prime_number_count(const int n)
{
    int cnt;
    bool was_not_divisible;
    
    if (n < 2){
        return 0;
    }
    
    cnt = 1;
    for (int i = 3; i <= n; i += 2){  // dividend: 被除数
        was_not_divisible = true;
        for (int j = 3; j * j <= i; j += 2){  // divisor: 除数
            if (i % j == 0){
                was_not_divisible = false;
                break;
            }
        }
        if (was_not_divisible){
            cnt++;
        }
    }
    
    return cnt;
}

int main()
{
    int n;
    
    while (std::cin >> n){
        std::cout << prime_number_count(n) << std::endl;
    }
    
    return 0;
}