#include <bits/stdc++.h>
using namespace std;
int setBit(int n, int pos) { return n = n | (1 << pos); }
int resetBit(int n, int pos) { return n = n & ~(1 << pos); }
bool checkBit(long long n, long long pos) { return (bool)(n & (1LL << pos)); }
namespace pcf {
unsigned int ar[(1000010 >> 6) + 5] = {0};
int len = 0;
int primes[1000010];
int counter[1000010];
int phi_dp[100000][100];
bool isComp[1000010];
void Sieve(int N) {
  int i, j, sq = sqrt(N);
  isComp[1] = true;
  for (i = 4; i <= N; i += 2) isComp[i] = true;
  for (i = 3; i <= sq; i += 2) {
    if (!isComp[i]) {
      for (j = i * i; j <= N; j += i + i) isComp[j] = 1;
    }
  }
  for (i = 1; i <= N; i++) {
    if (!isComp[i]) primes[len++] = i;
    counter[i] = len;
  }
}
void init() {
  Sieve(1000010 - 1);
  int k, n, res;
  for (n = 0; n < 100000; n++) phi_dp[n][0] = n;
  for (k = 1; k < 100; k++) {
    for (n = 0; n < 100000; n++) {
      phi_dp[n][k] = phi_dp[n][k - 1] - phi_dp[n / primes[k - 1]][k - 1];
    }
  }
}
long long phi(long long n, int k) {
  if (n < 100000 && k < 100) return phi_dp[n][k];
  if (k == 1) return ((++n) >> 1);
  if (primes[k - 1] >= n) return 1;
  return phi(n, k - 1) - phi(n / primes[k - 1], k - 1);
}
long long Legendre(long long n) {
  if (n < 1000010) return counter[n];
  int lim = sqrt(n) + 1;
  int k = upper_bound(primes, primes + len, lim) - primes;
  return phi(n, k) + (k - 1);
}
long long Lehmer(long long n) {
  if (n < 1000010) return counter[n];
  long long w, res = 0;
  int i, j, a, b, c, lim;
  b = sqrt(n), c = Lehmer(cbrt(n)), a = Lehmer(sqrt(b)), b = Lehmer(b);
  res = phi(n, a) + (((b + a - 2) * (b - a + 1)) >> 1);
  for (i = a; i < b; i++) {
    w = n / primes[i];
    lim = Lehmer(sqrt(w)), res -= Lehmer(w);
    if (i <= c) {
      for (j = i; j < lim; j++) {
        res += j;
        res -= Lehmer(w / primes[j]);
      }
    }
  }
  return res;
}
}  // namespace pcf
int main() {
  pcf::init();
  long long n, ans = 0, x, y;
  scanf("%lld", &n);
  for (int i = 0; i < pcf::len; i++) {
    x = pcf::primes[i];
    if (x * x * x > n) break;
    ans++;
  }
  for (int i = 0; i < pcf::len; i++) {
    x = pcf::primes[i];
    if (x * x > n) break;
    y = n / x;
    ans += pcf::Lehmer(y) - pcf::Lehmer(x);
  }
  printf("%lld\n", ans);
  return 0;
}
