#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e6 + 6;
bool prime[MAX];
int prec[MAX];
vector<int> P;
long long rec(long long N, int K) {
  if (N <= 1 || K < 0) return 0;
  if (N <= P[K]) return N - 1;
  if (N < MAX && 1LL * (P[K]) * P[K] > N) return N - 1 - prec[N] + prec[P[K]];
  const int LIM = 250;
  static int memo[LIM * LIM][LIM];
  bool ok = N < LIM * LIM && K < LIM;
  if (ok && memo[N][K]) return memo[N][K];
  long long ret = N / P[K] - rec(N / P[K], K - 1) + rec(N, K - 1);
  if (ok) memo[N][K] = ret;
  return ret;
}
long long count_primes(long long N) {
  if (N < MAX) return prec[N];
  int K = prec[(int)sqrt(N) + 1];
  return N - 1 - rec(N, K) + prec[P[K]];
}
void init_count_primes() {
  prime[2] = true;
  for (int i = 3; i < MAX; i += 2) prime[i] = true;
  for (int i = 3; i * i < MAX; i += 2)
    if (prime[i])
      for (int j = i * i; j < MAX; j += i + i) prime[j] = false;
  for (int i = 0; i < MAX; i++)
    if (prime[i]) P.push_back(i);
  for (int i = 1; i < MAX; i++) prec[i] = prec[i - 1] + prime[i];
}
int main() {
  init_count_primes();
  long long n;
  cin >> n;
  long long ans = 0;
  for (int i = 0; i < P.size(); i++) {
    if (1LL * P[i] * P[i] * P[i] <= n)
      ans++;
    else
      break;
  }
  for (int i = 0; i < P.size(); i++) {
    if (n / P[i] >= P[i])
      ans += count_primes(n / P[i]) - count_primes(P[i]);
    else
      break;
  }
  cout << ans << endl;
}
