#include <bits/stdc++.h>
using namespace std;
const int N = 333333;
int len = 0, vis[N];
long long p2[N];
long long ans[N];
long long phi[10005][111];
void init() {
  len = 0;
  for (int i = 2; i < N; i++) {
    if (!vis[i]) {
      for (int j = i + i; j < N; j += i) vis[j] = 1;
      p2[len++] = 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 / p2[j - 1]][j - 1];
    }
  }
}
long long get_phi(long long m, long long n) {
  if (!n) return m;
  if (p2[n - 1] >= m) return 1;
  if (m <= 10000 && n <= 100) return phi[m][n];
  return get_phi(m, n - 1) - get_phi(m / p2[n - 1], n - 1);
}
long long get_ans(long long m) {
  if (m < (long long)N) return ans[m];
  long long y = (int)cbrt(m * 1.0);
  long long n = ans[y];
  long long sum = get_phi(m, n) + n - 1;
  for (long long i = n; p2[i] * p2[i] <= m; i++) {
    sum = sum - get_ans(m / p2[i]) + get_ans(p2[i] - 1);
  }
  return sum;
}
int main() {
  long long n;
  init();
  scanf("%lld", &n);
  long long S = cbrt(n * 1.0);
  S = get_ans(S);
  long long tmp = 0;
  for (int i = 0; i < len; i++) {
    if (p2[i] * p2[i] >= n) break;
    long long x = n / p2[i];
    long long temp_s = get_ans(x);
    temp_s--;
    temp_s -= tmp;
    tmp = get_ans(p2[i]);
    S += temp_s;
  }
  printf("%lld\n", S);
  return 0;
}
