#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
using namespace std;
#define NUM 10000000
bool is_prime[NUM];
int dp[NUM];
int main(void) {
    for (int i = 0; i < NUM; i++) {
        is_prime[i] = true;
        dp[i] = 0;
    }
    is_prime[0] = is_prime[1] = false;
    for (int i = 2; i * i < NUM; i++) {
        if (is_prime[i]) {
            for (int j = 2; i * j < NUM; j++) {
                is_prime[i*j] = false;
            }
        }
    }
    for (int i = 1; i < NUM; i++) {
        if (is_prime[i]) dp[i] = dp[i-1] + 1;
        else dp[i] = dp[i-1];
    }
    long long n;
    while (cin >> n) {
        cout << dp[n] << endl;
    }
    return 0;
}