#include <bits/stdc++.h>
const int MAXN = 1e6 + 5;
bool p[MAXN];
int prime[MAXN], cnt, tot;
long long n;
int lim;
int id1[MAXN], id2[MAXN];
long long sm[MAXN], di[MAXN];
inline int getid(long long x) {
  if (x <= lim) return id1[x];
  return id2[n / x];
}
inline void prework(int lim) {
  for (int i = 2; i <= lim; ++i) {
    if (!p[i]) prime[++cnt] = i;
    for (int j = 1; j <= cnt && 1ll * i * prime[j] <= lim; ++j) {
      p[i * prime[j]] = 1;
      if (!(i % prime[j])) break;
    }
  }
}
int main() {
  scanf("%lld", &n);
  lim = std::sqrt(1.0 * n) + 1;
  prework(lim);
  for (long long l = 1, r; l <= n; l = r + 1) {
    long long x = n / l;
    r = n / x;
    if (x <= lim)
      id1[x] = ++tot;
    else
      id2[r] = ++tot;
    di[tot] = x;
  }
  for (int i = 1; i <= tot; ++i) sm[i] = di[i] - 1;
  for (int i = 1; i <= cnt; ++i) {
    int p = prime[i];
    for (int j = 1; j <= tot; ++j) {
      long long n = di[j];
      if (1ll * p * p > n) break;
      sm[j] -= sm[getid(n / p)] - (i - 1);
    }
  }
  long long ans = 0;
  for (int i = 1; i <= cnt; ++i) {
    ans += std::max(0ll, sm[getid(n / prime[i])] - i);
  }
  for (int i = 1; i <= cnt; ++i) {
    if (1ll * prime[i] * prime[i] * prime[i] > n) break;
    ++ans;
  }
  printf("%lld\n", ans);
  return 0;
}
