#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)

using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;

const int MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1000000000000000000L;
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
const int ddx[] = {1, 1, 0, -1, -1, -1, 0, 1};
const int ddy[] = {0, 1, 1, 1, 0, -1, -1, -1};

int extgcd(int a, int b, int& x, int&y) {
    int d = a;
    if(b != 0) {
        d = extgcd(b, a % b, y, x);
        y -= (a / b) * x;
    }else {
        x = 1;
        y = 0;
    }
    return d;
}

int inv(int a) {
    int x, y;
    extgcd(a, MOD, x, y);
    return (x + MOD) % MOD;
}

const int MAX_N = 1000000;
bool ifprime[MAX_N + 1];
bool used[MAX_N + 1];
int sum [MAX_N + 1];

int main() {
    fill(used, used + MAX_N + 1, false);
    fill(ifprime, ifprime + MAX_N + 1, false);
    for(int i = 2; i <= MAX_N; i++) {
        if(!used[i]) {
            used[i] = true;
            ifprime[i] = true;
            for(int j = 1; i * j <= MAX_N; j++) {
                used[i * j] = true;
            }
        }
    }

    sum[0] = 0;
    rep(i, MAX_N) {
        sum[i + 1] = sum[i];
        if(ifprime[i + 1]) sum[i + 1]++;
    }

    int n;
    while(cin >> n) {
        cout << sum[n] << endl;
    }
}

