#include <bits/stdc++.h>
inline long long getint() {
  register char ch;
  while (!isdigit(ch = getchar()))
    ;
  register long long x = ch ^ '0';
  while (isdigit(ch = getchar())) x = (((x << 2) + x) << 1) + (ch ^ '0');
  return x;
}
const int LIM = 316228, P = 27294;
bool vis[LIM];
int lim, p[P], sum[LIM], last[LIM * 2], cnt;
long long n, val[LIM * 2], f[LIM * 2];
inline void sieve() {
  for (register int i = 2; i <= lim; i++) {
    if (!vis[i]) p[++p[0]] = i;
    sum[i] = sum[i - 1] + !vis[i];
    for (register int j = 1; j <= p[0] && i * p[j] <= lim; j++) {
      vis[i * p[j]] = true;
      if (i % p[j] == 0) break;
    }
  }
}
int main() {
  lim = sqrt(n = getint());
  sieve();
  for (register long long i = 1; i <= n; i = n / (n / i) + 1) {
    val[++cnt] = n / i;
  }
  std::reverse(&val[1], &val[cnt] + 1);
  std::copy(&val[1], &val[cnt + 1], &f[1]);
  for (register int i = 1; i <= p[0]; i++) {
    const int pos =
        std::lower_bound(&val[1], &val[cnt] + 1, (long long)p[i] * p[i]) - val;
    for (register int j = cnt; j >= pos; j--) {
      const long long k = val[j] / p[i], pos = k <= lim ? k : cnt + 1 - n / k;
      f[j] -= f[pos] + last[pos] - i + 1;
      last[j] = i;
    }
  }
  long long ans = 0;
  for (register int i = 1; i <= cnt; i++) {
    f[i] += last[i] - 1;
  }
  for (register int i = 1; i <= p[0]; i++) {
    ans += f[cnt + 1 - p[i]] - i;
  }
  if (n != 1)
    ans += std::upper_bound(&p[1], &p[p[0]] + 1, floor(pow(n, 1. / 3))) - &p[1];
  printf("%lld\n", ans);
  return 0;
}
