#include<iostream>
#include <cstdio>
#include<cmath>
#include<vector>
#include<algorithm>
#include<cstring>

using namespace std;

////Nayeem Shahriar Joy,Applied Physics &Electronic Engineering,University of Rajshahi.

int main()

{
    bool prime[1000001];
    memset(prime,true,sizeof(prime));
    for( int i=4;i<=999999;i=i+2)
    {
        prime[i]=false;
    }
    for(int i=3;i*i<=999999;i++)
    {
        if(prime[i]==true){
        for(int j=i*2;j<=999999;j=j+i)
        {
            prime[j]=false;
        }
        }
    }
    int n;

    while(cin>>n)
    {
        int count=0;
        for( int i=2;i<=n;i++)
        {
            if(prime[i]==true)
            {
                count++;
            }
        }
        cout<<count<<endl;
    }
    return 0;
}