#include<iostream>
#include<math.h>
#include<string.h>
#define N 1000000
#define rep(i,a,b,c) for(int i=a;i<=b;i+=c)
using namespace std;
int a[1000000];
void seive (){
    int n=sqrt(N);
    int i,j;
    memset(a,0,sizeof(a));
    a[0]=a[1]=1;
    rep(i,2,n,1){
        if(!a[i]){
            rep(j,i+i,N,i){
                a[j]=1;
            }
        }
    }
}

int main(){
    seive();
    int m;
    while(cin>>m){
        int cnt = 0;
        rep(i,0,m,1){
            if(!a[i])cnt++;
        }
        cout << cnt << endl;
    }
    return 0;
}