#include <iostream>
using namespace std;

long length;
long prime[1000000];
bool isPrime(long n)
{
    bool isprimep = true;
    for(int i=0; i < length-1; i++)
        {
            if (!(n % prime[i]))
                {
                    isprimep = false;
                    break;
                }
        }
    return isprimep;
}

int main(void)
{
    long num;

    while(cin >> num)
    {
        length = 0;
        for (int n = 2; n <= num; n++)
        {
            if (isPrime(n))
            {
                prime[length] = n;
                length++;
            }
        }
        cout << length << endl;
    }
    return 0;
}