#include<iostream>
#include<cmath>
using namespace std;

inline bool isPrime(unsigned int n);

int main()
{
    int n;
    while(cin>>n){
        int count=0;
        for(int i=0; i<=n; i++){
            if(isPrime(i)) count++;
        }
        cout << count << endl;
    }

    return 0;
}

inline bool isPrime(unsigned int n)
{
    if( n==0 || n==1 ) return false;
    if( n==2 ) return true;
    if(!(n%2)) return false;
    
    int rn = static_cast<int>(sqrt(n));
    
    bool flag = true;
    for(int i=3; i<=rn; i+=2){
        if(!(n%i)){
            flag = false;
            break;
                }
    }
    return flag;
}