#include <bits/stdc++.h>
using namespace std;

#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
typedef long long ll;

const long long INF = 1LL << 60;

int sieve(int n) {
    int p = 0;
    vector<bool> prime(n + 1, true);
    prime[0] = prime[1] = false;
    for (int i = 2; i <= n; i++) {
        if (prime[i]) {
            p++;
            for (int j = i * 2; j <= n; j += i) prime[j] = false;
        }
    }
    return p;
}

int main()
{
    int n;
    while (scanf("%d", &n) != EOF) {
        cout << sieve(n) << endl;
    }
    return 0;
}
