#include<iostream>
using namespace std;
#define REP(i,n) for(unsigned int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define MAX 1000001
 
bool N[MAX] = {};
 
int M[MAX] = {};
 
void SoE()
{
    REP(i, MAX)N[i] = true;
 
    N[1] = true;
    for (unsigned int i = 2; i*i <= MAX; i++)
    {
        for (unsigned int j = i+i; j < MAX; j += i)
        {
            N[j] = false;
        }
    }
}
 
void Count()
{
    M[1] = 0;
    FOR(i, 2, MAX - 1)
    {
        int add = 0;
        if (N[i] == true)
        {
            add = 1;
        }
        M[i] = M[i - 1] + add;
    }
}
 
int main()
{
    SoE();
    Count();
    int tmp;
    while (cin >> tmp)
    {
        cout << M[tmp] << endl;
    }
    return 0;
}
