#include <bits/stdc++.h>
using namespace std;
inline long long mod(long long n, long long m) {
  long long ret = n % m;
  if (ret < 0) ret += m;
  return ret;
}
long long gcd(long long a, long long b) {
  return (b == 0LL ? a : gcd(b, a % b));
}
long long exp(long long a, long long b, long long m) {
  if (b == 0LL) return 1LL;
  if (b == 1LL) return mod(a, m);
  long long k = mod(exp(a, b / 2, m), m);
  if (b & 1LL) {
    return mod(a * mod(k * k, m), m);
  } else
    return mod(k * k, m);
}
const int N = 2e6 + 100;
long long pref_pi[N];
const int NN = 2e5 + 100;
const int NP = 100;
long long dp[NN][NP];
vector<long long> primes;
bool isp[N];
void crivo() {
  for (int i = 2; i < N; i++) isp[i] = 1;
  for (int i = 1; i < N; i++) {
    if (isp[i]) {
      primes.push_back(i);
      for (int j = 2 * i; j < N; j += i) isp[j] = 0;
    }
    pref_pi[i] = pref_pi[i - 1] + isp[i];
  }
  for (int i = 1; i < NN; i++) {
    dp[i][0] = i;
    for (int j = 1; j < NP; j++) {
      dp[i][j] = dp[i][j - 1] - dp[i / primes[j - 1]][j - 1];
    }
  }
}
long long icbrt(long long x) {
  int l = 1, r = 1e4;
  long long ans = 1;
  while (l <= r) {
    long long mid = (l + r) / 2;
    if (mid * mid * mid <= x)
      ans = mid, l = mid + 1;
    else
      r = mid - 1;
  }
  if (ans * ans * ans < x) ans++;
  return ans;
}
long long solve(long long x, int k) {
  if (x < NN and k < NP) return dp[x][k];
  if (k == 0) return x;
  if (x < primes[k - 1] * primes[k - 1]) return pref_pi[x] - (k - 1);
  return solve(x, k - 1) - solve(x / primes[k - 1], k - 1);
}
long long pi(long long x) {
  if (x < N) return pref_pi[x];
  int k = pref_pi[icbrt(x)];
  long long res = solve(x, k) + (k - 1);
  while (primes[k] * primes[k] <= x) {
    res -= (pi(x / primes[k]) - k);
    k++;
  }
  return res;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  crivo();
  long long n;
  cin >> n;
  long long ans = 0;
  int i = 0;
  for (long long p : primes) {
    if (p > n / p) break;
    if (1LL * p * p * p <= n) ans++;
    ans += pi(n / p) - i - 1;
    i++;
  }
  cout << ans << "\n";
}
