#include<iostream>
#include<cstdio>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<cstring>
#include<string>
#include<cmath>
#include<algorithm>
#define LL long long
using namespace std;

const int maxn=1e6;
int n,cnt,is_prime[maxn+10],prime[maxn+10],sum[maxn+10];

void init(){
    int i,j;
    for(i=2;i<=maxn;i++){
        if(!is_prime[i]){
        	prime[cnt++]=i;
        }
        for(j=0;j<cnt && i*prime[j]<=maxn;j++){
        	is_prime[i*prime[j]]=1;
        	if(i%prime[j]==0) break;
        }
        sum[i]=cnt;
    }
}

int main(void){
	init();
	while(scanf("%d",&n)!=EOF){
        printf("%d\n",sum[n]);
    }
    return 0;
}
