#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000010;
const int MAX_PRIMES = 1000010;
const int PHI_N = 100000;
const int PHI_K = 100;
int len = 0;
int primes[MAX_PRIMES];
int counter[MAXN];
int Is_Prime[MAXN + 2];
void Seive(int n) {
  Is_Prime[1] = 1;
  for (int i = 4; i <= n; i += 2) Is_Prime[i] = 1;
  int sq = sqrt(n + 1);
  for (int i = 3; i <= n; i += 2) {
    if (Is_Prime[i]) continue;
    if (i > sq) continue;
    for (int j = i * i; j <= n; j += 2 * i) Is_Prime[j] = 1;
  }
  for (int i = 1; i <= n; i++) {
    if (!Is_Prime[i]) primes[len++] = i;
    counter[i] = len;
  }
}
int phi_dp[PHI_N][PHI_K];
void LehmerInit() {
  Seive(MAXN);
  int k, n, res;
  for (n = 0; n < PHI_N; n++) phi_dp[n][0] = n;
  for (k = 1; k < PHI_K; k++) {
    for (n = 0; n < PHI_N; n++) {
      phi_dp[n][k] = phi_dp[n][k - 1] - phi_dp[n / primes[k - 1]][k - 1];
    }
  }
}
long long phi(long long n, int k) {
  if (n < PHI_N && k < PHI_K) return phi_dp[n][k];
  if (k == 1) return ((++n) >> 1);
  if (primes[k - 1] >= n) return 1;
  return phi(n, k - 1) - phi(n / primes[k - 1], k - 1);
}
long long Lehmer(long long n) {
  if (n < MAXN) return counter[n];
  long long w, res = 0;
  int i, j, a, b, c, lim;
  b = sqrt(n), c = Lehmer(cbrt(n)), a = Lehmer(sqrt(b)), b = Lehmer(b);
  res = phi(n, a) + (((b + a - 2) * (b - a + 1)) >> 1);
  for (i = a; i < b; i++) {
    w = n / primes[i];
    lim = Lehmer(sqrt(w)), res -= Lehmer(w);
    if (i <= c) {
      for (j = i; j < lim; j++) {
        res += j;
        res -= Lehmer(w / primes[j]);
      }
    }
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  LehmerInit();
  long long n, ans = 0, x, y;
  cin >> n;
  for (int i = 0; i < len; i++) {
    x = primes[i];
    if (x * x * x > n) break;
    ans++;
  }
  for (int i = 0; i < len; i++) {
    x = primes[i];
    if (x * x > n) break;
    y = n / x;
    ans += Lehmer(y) - Lehmer(x);
  }
  cout << ans << endl;
  return 0;
}
