#include <bits/stdc++.h>
using namespace std;
long long prime[320005], ans[320005];
long long phi[10005][105];
int cnt, vis[320005];
void init() {
  cnt = 0;
  for (int i = 2; i < 320005; i++) {
    if (!vis[i]) prime[cnt++] = i;
    for (int j = 0; j <= cnt && i * prime[j] < 320005; j++) {
      vis[i * prime[j]] = 1;
      if (i % prime[j] == 0) break;
    }
    if (!vis[i])
      ans[i] = ans[i - 1] + 1;
    else
      ans[i] = ans[i - 1];
  }
  for (int i = 0; i <= 10000; i++) {
    phi[i][0] = (long long)i;
    for (int j = 1; j <= 100; j++)
      phi[i][j] = phi[i][j - 1] - phi[i / prime[j - 1]][j - 1];
  }
}
long long solve_phi(long long m, long long n) {
  if (!n) return m;
  if (prime[n - 1] >= m) return 1;
  if (m <= 10000 && n <= 100) return phi[m][n];
  return solve_phi(m, n - 1) - solve_phi(m / prime[n - 1], n - 1);
}
long long solve(long long m) {
  if (m < (long long)320005) return ans[m];
  long long y = (long long)cbrt(m * 1.0);
  long long n = ans[y];
  long long sum = solve_phi(m, n) + n - 1;
  for (long long i = n; prime[i] * prime[i] <= m; i++)
    sum = sum - solve(m / prime[i]) + solve(prime[i]) - 1;
  return sum;
}
int main() {
  long long n;
  init();
  scanf("%I64d", &n);
  long long t = cbrt(n * 1.0);
  long long result = solve(t);
  for (int i = 0; i < cnt; i++) {
    if (prime[i] * prime[i] >= n) break;
    long long x = solve(prime[i]);
    long long y = solve(n / prime[i]);
    result += y - x;
  }
  printf("%I64d\n", result);
  return 0;
}
