#include <iostream>
#include <string>
#include <vector>

static const int InputMaxLen = 6;
class PrimeNumber {
public:
    void Run();

private:
    bool readData();
    bool calcPrimeNumber();
    void printData();
    bool checkDigit(int num);

private:
    std::vector<int> inputDataList;
    std::vector<int> ouotputDataList;
};

void PrimeNumber::Run()
{
    if (!readData()) {
        std::cout << "Failed read value." << std::endl;
        return;
    }
    if (!calcPrimeNumber()) {
        std::cout << "Failed calc prime number." << std::endl;
        return;
    }
    printData();
}

bool PrimeNumber::readData()
{
    int val = 0;

    while (std::cin >> val) {
        if (!checkDigit(val)) {
            return false;
        }
        inputDataList.push_back(val);
    }

    return true;
}

bool PrimeNumber::calcPrimeNumber()
{
    unsigned int val = 0;
    int cnt = 0;
    for (unsigned int i = 0; i < inputDataList.size(); ++i) {
        val = inputDataList.at(i);
        cnt = 0;
        if (!checkDigit(val)) {
            return false;
        }
        if (val >= 2) {
            cnt++;
        }
        if (val >= 3) {
            cnt++;
        }
        for (unsigned int j = 4; j <= val; ++j) {
            for (unsigned int k = 2; k <= j; ++k) {
                if (j == k) {
                    cnt++;
                }
                else if (0 == j % k) {
                    break;
                }
            }
        }
        ouotputDataList.push_back(cnt);
    }

    return true;
}

void PrimeNumber::printData()
{
    for (unsigned int i = 0; i < ouotputDataList.size(); ++i) {
        std::cout << ouotputDataList.at(i) << std::endl;
    }
}
// Check the value whether 6 digit.
bool PrimeNumber::checkDigit(int num)
{
    int cnt = 0;

    while (num > 0) {
        cnt++;
        num /= 10;
    }
    if (cnt > InputMaxLen) {
        return false;
    }
    return true;
}

int main()
{
    PrimeNumber obj;

    obj.Run();
}