#include <bits/stdc++.h>
using namespace std;
vector<int> isp(10100100);
vector<long long> primes, acum_pi(10100100);
int phi_table[300000][100];
unordered_map<long long, long long> dp;
void super_sieve_3000_ultron_beta() {
  for (int i = 2; i < 10100100; i++) isp[i] = 1;
  for (int i = 2; i < 10100100; i++) {
    if (isp[i]) {
      primes.push_back(i);
      for (int j = 2 * i; j < 10100100; j += i) isp[j] = 0;
    }
    acum_pi[i] = acum_pi[i - 1] + isp[i];
  }
  for (int i = 0; i < 300000; i++) {
    phi_table[i][0] = i;
    for (int k = 1; k < 100; k++) {
      phi_table[i][k] =
          phi_table[i][k - 1] - phi_table[i / primes[k - 1]][k - 1];
    }
  }
}
long long pi_(long long x);
long long solve(long long n, long long k) {
  if (n < 300000 && k < 100) return phi_table[n][k];
  if (k == 0) return n;
  if (k > primes.size()) return pi_(n) - k + 1;
  if (primes[k - 1] > n) return 1;
  if (n < primes[k - 1] * primes[k - 1]) return pi_(n) - k + 1;
  return solve(n, k - 1) - solve(n / primes[k - 1], k - 1);
}
long long pi_(long long x) {
  if (x < 10100100) return acum_pi[x];
  if (dp.count(x)) return dp[x];
  long long cubic_root = ceil(pow(x, 1. / 3));
  long long k = acum_pi[cubic_root];
  long long ret = solve(x, k) + k - 1;
  while (primes[k] * primes[k] <= x) {
    ret = ret - pi_(x / primes[k]) + k;
    k++;
  }
  return dp[x] = ret;
}
long long n, ans;
int main() {
  super_sieve_3000_ultron_beta();
  scanf("%lld", &n);
  for (int i = 0; i < primes.size(); i++) {
    long long pi = primes[i];
    if (pi >= n / pi) break;
    if (pi * pi * pi <= n) ans++;
    ans += pi_(n / pi) - i - 1;
  }
  printf("%lld\n", ans);
  return 0;
}
