#include <bits/stdc++.h>
using namespace std;
vector<int> isp(1000100);
vector<long long> primes, acum_pi(1000100);
long long sqn, K, phi_table[40000][200];
void crivo_super_modificado_3000_v2_beta() {
  for (int i = 2; i < 1000100; i++) isp[i] = 1;
  for (int i = 2; i < 1000100; i++) {
    if (isp[i]) {
      primes.push_back(i);
      for (int j = 2 * i; j < 1000100; j += i) isp[j] = 0;
    }
    acum_pi[i] = acum_pi[i - 1] + isp[i];
  }
  for (int i = 0; i < 40000; i++) {
    phi_table[i][0] = i;
    for (int k = 1; k < 200; k++) {
      phi_table[i][k] =
          phi_table[i][k - 1] - phi_table[i / primes[k - 1]][k - 1];
    }
  }
}
long long solve(long long n, long long k) {
  if (n < 40000 && k < 200) return phi_table[n][k];
  if (k == 0) return n;
  if (primes[k - 1] > n) return 1;
  return solve(n, k - 1) - solve(n / primes[k - 1], k - 1);
}
long long pi_(long long x) {
  if (x < 1000100) return acum_pi[x];
  long long cubic_root = ceil(pow(x, 1.0 / 3));
  long long k = acum_pi[cubic_root];
  long long ret = solve(x, k) + k - 1;
  while (primes[k] * primes[k] <= x) {
    ret = ret - pi_(x / primes[k]) + k;
    k++;
  }
  return ret;
}
long long n, ans;
int main() {
  crivo_super_modificado_3000_v2_beta();
  scanf("%lld", &n);
  K = ceil(pow(n / log(n), 2.0 / 3));
  for (int i = 0; i < primes.size(); i++) {
    long long pi = primes[i];
    if (pi >= n / pi) break;
    if (pi * pi * pi <= n) ans++;
    ans += pi_(n / pi) - i - 1;
  }
  printf("%lld\n", ans);
  return 0;
}
