//{Headers
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<ctime>
#include<iostream>
#include<string>
#include<algorithm>
#include<list>
#include<queue>
#include<deque>
#include<vector>
#include<stack>
#include<map>
#include<set>
#include<bitset>

using namespace std;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef pair< int,int > pii;
#define mp(x,y) make_pair(x,y)
typedef long long ll;
//}

const int MAXN=1e6;
int N,nPrime[MAXN];

bool isPrime[MAXN];
void EratosthenesSeive(){
    memset(isPrime,true,sizeof isPrime);
    isPrime[0]=isPrime[1]=false;
    for(int i=2;i<MAXN;i++) if(isPrime[i]){
        for(int j=i<<1;j<MAXN;j+=i)
            isPrime[j]=false;
    }
}

void init(){
    EratosthenesSeive();
    nPrime[0]=0;
    for(int i=1;i<MAXN;i++) nPrime[i]=nPrime[i-1]+(isPrime[i]?1:0);
}

void solve(){printf("%d\n",nPrime[N]);}

int main(void){
//    freopen("in.txt","r",stdin);
    init();
    while(~scanf("%d",&N))
        solve();
    return 0;
}

/*
Sample Input
10
3
11
Output for the Sample Input
4
2
5
*/

