#include <cstdio>
#include <algorithm>
#include <vector>
 
using namespace std;

const int kMaxN = 1000000;

int main()
{
    vector<int> prime;
    prime.reserve(100000);
    prime.push_back(2);
    prime.push_back(3);
    prime.push_back(5);
    prime.push_back(7);
    for (int i = 9; i <= kMaxN; i += 2){
        bool ok = true;
        for (int j = 0, j_max = prime.size(); j < j_max; ++j){
            if (i % prime[j] == 0){
                ok = false;
                break;
            }
        }
        if (ok) prime.push_back(i);
    }

    int n; 
    while (scanf("%d", &n) != EOF){
        int count = upper_bound(prime.begin(), prime.end(), n) - prime.begin();
        printf("%d\n", count);
    }
     
    return (0);
}