#include <bits/stdc++.h>

using namespace std;

#define all(x) x.begin(), x.end()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define reps(i, m, n) for (int i = m; i <= n; ++i)

using i64 = long long;
using pii = pair<i64, i64>;

template<class A, class B>inline bool chmax(A &a, const B &b){return b > a ? a = b,1 : 0;}
template<class A, class B>inline bool chmin(A &a, const B &b){return b < a ? a = b,1 : 0;}

constexpr int INF = 0x3f3f3f3f;
constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int MOD = int(1e9) + 7;

vector<bool> isPrime;

void sieve(int MAX) {
  if (MAX + 1 > isPrime.size()) isPrime.resize(MAX + 1, true);
  isPrime[0] = false;
  isPrime[1] = false;
  for (int i = 2; i * i <= MAX; ++i) {
    if (isPrime[i]) {
      for (int j = 2; i * j <= MAX; ++j) isPrime[i*j] = false;
    }
  }
}

signed main()
{
  ios::sync_with_stdio(false);
  cin.tie(nullptr);

  sieve(10000010);

  vector<int> cum(10000015);
  for (int i = 1; i <= 10000010; ++i) {
    cum[i] = cum[i-1];
    if (isPrime[i]) ++cum[i];
  }

  i64 n;
  while (cin >> n) {
    cout << cum[n] << "\n";
  }

  return 0;
}
