#include <iostream>
#include <cmath>
#define N 1000000

bool m[N];

void init_array() {
    int n = N-1;
    int idx = 2;
    std::fill(m, m+N, true);
    while (idx <= sqrt(n)) {
        int next_itr = -1;
        for (int i=idx+1; i<=n; i++) {
            if (m[i]) {
                if (i % idx == 0) {
                    m[i] = false;
                } else if (next_itr == -1) {
                    next_itr = i;
                }
            }
        }
        idx = next_itr;
    }
}

int main(void) {
    int n;
    int res;
    init_array();
    while( std::cin >> n ) {
        int idx = 2;
        int res=0;

        for (int i=2; i<=n; i++) {
            if (m[i]) res++;
        }

        std::cout << res << std::endl;
    }

    return 0;
}

