#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;

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

#define MOD 1000000007
#define REP(i, N) for (int i = 0; i < N; ++i)
#define REP1(i, N) for (int i = 1; i <= N; ++i)
#define RREP(i, N) for (int i = N - 1; i >= 0; --i)
#define ALL(a) a.begin(), a.end()

int main() {
  bool is_prime[1000000];
  REP1(i, 999999) is_prime[i] = true;
  is_prime[0] = is_prime[1] = false;
  for (int i = 2; i * i <= 999999; ++i) {
    if (is_prime[i]) {
      for (int j = 2; i * j <= 999999; ++j) is_prime[i * j] = false;
    }
  }
  int sum[1000000];
  sum[0] = 0;
  REP1(i, 999999) sum[i] = sum[i - 1] + is_prime[i];
  int n;
  while (cin >> n) cout << sum[n] << endl;
  return 0;
}
