#include<bits/stdc++.h>
using namespace std;
int prime[1000005],e;
bool is_prime[1000005];
int presum[1000005];
void solve()
{
    prime[0]=prime[1]=1;
    for(int i=2;i<=1000000;i++)
    {
        if(!is_prime[i])
        {
            prime[++e]=i;
            if((long long)i*i>1000000) continue;
            for(int j=i*i;j<=1000000;j+=i) is_prime[j]=1;
        }
    }
}
void pre()
{
    presum[0] =presum[1]= 0;
    for(int i = 2; i <=1000000; i++)
        presum[i] = is_prime[i] ? presum[i - 1]: presum[i - 1]+1;
}
int main()
{
    int n;
    solve();
    pre();
    //cout<<e;
    while(cin>>n)
    {
       cout<<presum[n]<<endl;
    }

   return 0;
}
