#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <cmath>
using namespace std;
typedef vector<int> VI;
#define REP( i, m, n ) for ( int i = (int)( m ); i < (int)( n ); ++i )

template<typename T>
T getPrimeNum(vector<bool> primes, T index) {
    T ret = 0;
    for (auto i = 0; i <= index; i++) {
        if (primes.at(i)) {
            ++ret;
        }
    }
    return ret;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    vector<bool> primes(1000000, true);
    primes[0] = false;
    primes[1] = false;
    for (unsigned long n = 2; n < 1000000; n++) {
        if (n*n > 1000000)    break;
        if (!n)    continue;
        for(unsigned long i = n+n; i < 1000000; i=i+n) {
            primes[i] = false;
        }
    }

    unsigned long input;
    vector<unsigned long> inputs;
    while (cin >> input) {
        inputs.push_back(input);
    }

    for (auto n : inputs) {
        cout << getPrimeNum(primes, n) << endl;
    }

    return 0;
}