#include <iostream>
#include <cstdio>
using namespace std;
const int MAX_N = 1000005;
bool is_prime[MAX_N];
int n;
int main(int argc, const char * argv[])
{
    while (~scanf("%d", &n)) {
        for (int i = 2; i <= n; i++) is_prime[i] = true;
        //エラストテネスのふるい
        int count = 0;
        for (int i = 2; i <= n; i++) {  //2からnまで確認
            if (is_prime[i]) {  //素数iを発見
                count++;
                for (int j = 2*i; j <= n; j += i) {  //iの倍数を消す
                    is_prime[j] = false;
                }
            }
        }
        printf("%d\n",count);
    }
    
    return 0;
}