///BISMILLAHIR RAHMANIR RAHMIM
#include <bits/stdc++.h>
using namespace std;
#define MAX 1000002
int pri[MAX+2];
int cnt[MAX+2];
void sieve(int n)
{
    pri[1]=1;
    for (int i=2;i<=n;i++)
    {
        if(pri[i]==0)
        {
            for (int j=i+i;j<=n;j+=i)
            {
                pri[j]=1;
            }
        }
    }
    int tot = 0;
    for(int i = 1;i<=n;i++)
    {
        if(pri[i]==0)
            tot++;
        cnt[i] = tot;
    }
}
int main ()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    sieve(MAX);
    int n;
    while(cin>>n)
    {
        cout << cnt[n] << "\n";
    }
    return 0;
}