#include <bits/stdc++.h>
using namespace std;
const int maxn=1e6;
#define ll long long
int pri[maxn];int vis[maxn];int rec[maxn];int op=0;int t;
void advan(){
     vis[1]=1;
     for(ll i=1;i<=1e6;i++){
        rec[i]=op;if(vis[i])continue;
        vis[op++]=1;rec[i]=op;
        for(ll j=i*i;j<1e6;j=j+i){
            vis[j]=1;
}}}
int main(){
    advan();int n;
    while(scanf("%d",&n)!=EOF){
        printf("%d\n",rec[n]);
    }
}