#include <bits/stdc++.h>
using namespace std;
long long P(long long m, long long n);
long long pi(long long x);
long long phi(long long m, long long n);
bool isprm[400005];
int cntprm[400005];
vector<long long> prm;
void Init() {
  for (int i = 2; i <= 400000; ++i) {
    isprm[i] = true;
  }
  for (int i = 2; i <= 400000; ++i) {
    cntprm[i] = cntprm[i - 1] + isprm[i];
    if (isprm[i]) {
      prm.push_back(i);
      for (int j = i + i; j <= 400000; j += i) isprm[j] = false;
    }
  }
}
long long sol(long long x) {
  long long ans = 0;
  long long sq = sqrt(x);
  for (int i = 0; i < (int)prm.size() && prm[i] <= sq; ++i) {
    long long a = prm[i], b = x / a;
    if (b <= 400000)
      ans += cntprm[b] - cntprm[a];
    else {
      ans += pi(b) - cntprm[a];
    }
  }
  return ans;
}
int main(void) {
  long long n;
  Init();
  cin >> n;
  cout << cntprm[(int)cbrt(n)] + sol(n) << "\n";
}
long long phi(long long m, long long n) {
  if (m) {
    if (n) {
      if (m <= prm[n - 1])
        return 1;
      else {
        if (prm[n - 1] * prm[n - 1] >= m)
          return pi(m) - n + 1;
        else
          return phi(m, n - 1) - phi(m / prm[n - 1], n - 1);
      }
    } else {
      return m;
    }
  } else {
    return 0;
  }
}
long long P(long long m, long long n) {
  long long res = 0, sq = sqrt(m);
  for (int i = n; i < (int)prm.size() && prm[i] <= sq; ++i) {
    auto num = prm[i];
    res += pi(m / num) - pi(num) + 1;
  }
  return res;
}
long long pi(long long x) {
  if (x <= 400000)
    return cntprm[x];
  else {
    long long n = pi(ceil(cbrt(x))), m = x;
    return phi(m, n) + n - 1 - P(m, n);
  }
}
