
#include<iostream>
#include<cstdio>

using namespace std;

const int maxn=1e6+5;

int isprime[maxn];

int solve(int n)
{
    int p=0;
    for(int i=2;i<=n;i++){
        if(!isprime[i]){
            p++;
        }
        for(int j=2*i;j<=n;j+=i){
            isprime[j]=1;
        }
    }
    return p;
}

int main()
{
    int n;
    while(~scanf("%d",&n)){
        cout<<solve(n)<<endl;
    }
    return 0;
}

