#include<stdio.h>
#include<iostream>
#include<string.h>
#include<vector>
#include<math.h>
#include<queue>
#include<algorithm>

using namespace std;

long store[999999];
//long storage[999999];
//int index=1;
bool IsPrime(long prime){
    if(prime==store[prime]){
        /*if(storage[index]!=0){
            storage[index]=storage[index]+1;
            index++;
        }*/
        return true;
    }
    //storage[index]=storage[index-1];
    //index++;
    bool ans=false;
    if(prime==2){
        store[prime]=prime;
        return true;
    }
    if(prime==3){
        store[prime]=prime;
        return true;
    }
    for(long i=2;i<=sqrt(prime);i++){
        if(prime%i==0) {
            return false;
        }
        else ans=true;
    }
    if(ans==true)   store[prime]=prime;
    return ans;
}

int main(){
    long n;

    //memset(storage,0,999999);
    while(scanf("%d",&n)==1){
        memset(store,-1,999999);
        long count=0;
        for(long i=n;i>0;i--){
            /*if(storage[i]!=0){
                count=count+storage[i];
                break;
            }*/
            if(IsPrime(i)==true)    count++;
        }
        printf("%ld\n",count);
    }

    return 0;
}