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

using namespace std;

int main()
{
    int n, flag, c = 1;
    long long a[99999];
    for(int i=2; i<=99999; i++)
    {
        flag = 0;
        for(int j=2; j<=sqrt(i); j++)
        {
            if(i % j == 0)
            {
                flag = 1;
            }
        }
        if(flag == 0)
        {
            a[i] = 1;
        }
        else
        {
            a[i] = -1;
        }
    }

    while(scanf("%d",&n) != EOF)
    {
        int m = 0;
        for(int i=2; i<=n; i++)
        {
            if(a[i] == 1)
            m++;
        }

        cout<<m<<endl;
    }
}