#include <bits/stdc++.h>
using namespace std;
long long read() {
  long long a = 0, b = getchar(), c = 1;
  while (!isdigit(b)) c = b == '-' ? -1 : 1, b = getchar();
  while (isdigit(b)) a = a * 10 + b - '0', b = getchar();
  return a * c;
}
long long n, m = 1, k, ans, dp[350005], g[350005];
void gao() {
  for (long long i = 2; i <= m; i++) {
    if (g[i] == g[i - 1]) continue;
    for (long long j = 1; j <= min(m - 1, n / i / i); j++) {
      if (i * j < m)
        dp[j] -= dp[i * j];
      else
        dp[j] -= g[n / i / j];
      dp[j] += g[i - 1];
    }
    for (long long j = m; j >= i * i; j--) g[j] += g[i - 1] - g[j / i];
  }
}
int main() {
  n = read();
  k = pow(n, 1.0 / 3) + 1e-9;
  while (m * m <= n) {
    dp[m] = n / m - 1;
    m++;
  }
  for (long long i = 1; i <= m; i++) g[i] = i - 1;
  gao();
  for (long long i = 2; i < m; i++)
    if (g[i] != g[i - 1]) ans += dp[i] - g[i];
  printf("%lld", ans + g[k]);
  return 0;
}
