#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <utility>
#include <queue>
#include <vector>
#include <map>
#include <set>
#include <bitset>
using namespace std;
typedef long long ll;
//#define local
//if you find any bug in my code, please tell me.
const int N=1e6+10;
bool prime[N];
int ans[N];
void init()
{
    prime[0]=prime[1]=false;
    for(int i=2; i<=N; i++)
        prime[i]=true;
    int cnt=0;
    for(int i=2; i<=N; i++)
    {
        if(prime[i])
        {
            cnt++;
            for(int j=2*i; j<=N; j+=i)
                prime[j]=false;
        }
        ans[i]=cnt;
    }
}
int main()
{
#ifdef local
    freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
#endif
    init();
    int n;
    while(~scanf("%d",&n))
    {
        printf("%d\n",ans[n]);
    }
    return 0;
}

