#include <bits/stdc++.h>
const int maxN = 1e6 + 5;
long long L[maxN], S[maxN];
bool used[maxN];
long long PrimeCount(long long N) {
  long long sn = sqrt(N);
  for (long long i = 1; i <= sn; ++i) {
    used[i] = false;
    S[i] = i - 1;
    L[i] = N / i - 1;
  }
  for (long long p = 2; p <= sn; ++p) {
    if (S[p] == S[p - 1]) continue;
    long long s = S[p - 1];
    long long q = p * p;
    long long range = (p & 1) + 1;
    long long end = std::min(sn, N / q);
    L[1] -= L[p] - s;
    for (long long i = p + range; i <= end; ++i) {
      if (used[i]) continue;
      L[i] -= (i * p <= sn ? L[i * p] : S[N / i / p]) - s;
    }
    if (q <= sn) {
      range *= p;
      for (long long i = q; i < end; i += range) used[i] = true;
    }
    for (long long i = sn; i >= q; --i) S[i] -= S[i / p] - s;
  }
  return L[1];
}
int pri[maxN], cnt[maxN], totP;
bool flag[maxN];
void Euler(int n) {
  for (int i = 2; i <= n; ++i) {
    if (!flag[i]) cnt[pri[++totP] = i] = 1;
    for (int j = 1; pri[j] * i <= n; ++j) {
      flag[i * pri[j]] = true;
      if (i % pri[j] == 0) break;
    }
    cnt[i] += cnt[i - 1];
  }
}
int main() {
  if (fopen("input.txt", "r")) {
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
  }
  long long n, sn;
  std::cin >> n;
  Euler(sn = sqrt(n));
  long long ret = 0;
  for (int i = 1; i <= totP; ++i) {
    ret += (n / pri[i] > sn ? PrimeCount(n / pri[i]) : cnt[n / pri[i]]) -
           cnt[pri[i]];
  }
  long long t = 0;
  while ((t + 1) * (t + 1) * (t + 1) <= n) ++t;
  ret += cnt[t];
  std::cout << ret << std::endl;
  return 0;
}
