#include <iostream>
#include <cstdio>
#include <cmath>

using namespace std;

int count = 0;

bool isPrime(int n)
{
    if (n == 2) return true;
    else if (n%2 ==0 || n<0)
    {
        return false;
    }
    else
    {
        int k = sqrt(n);
        for (int i=3; i<=k; i+=2)
        {
            if (n%i == 0)
            {
                return false;
            }
        }
        return true;
    }
}

int main()
{
    int count = 0;
    int n;
    while (scanf("%d", &n) != EOF)
    {
        for (int i=2; i<=n; i++)
        {
            if (isPrime(i))
            {
                count ++;
            }
        }
        printf("%d\n",count);
        count = 0;
    }


    return 0;
}