#include <bits/stdc++.h>
using namespace std;
const long long N = 5e5;
bool tab[N + 1];
long long pi[N + 1];
long long hi[N + 1];
vector<long long> primes;
int main() {
  long long n;
  cin >> n;
  for (int i = 1; i <= N; i++) {
    pi[i] = i;
    hi[i] = n / i;
    tab[i] = true;
  }
  for (int i = 2; i <= N; i++) {
    if (tab[i]) {
      primes.push_back(i);
      for (int j = i * 2; j <= N; j += i) {
        tab[j] = false;
      }
    }
  }
  for (int i = 0; i < primes.size(); i++) {
    long long p = primes[i];
    for (int j = 1; j <= min(N, n / (p * p)); j++) {
      long long k = n / j / p;
      hi[j] -= (k <= N ? pi[k] : hi[j * p]) - (i + 1);
    }
    for (int j = N; j >= p * p; j--) {
      pi[j] -= pi[j / p] - (i + 1);
    }
  }
  long long ans = 0;
  for (long long p : primes) {
    if (p * p * p <= n) {
      ans++;
    }
    ans += max(0LL, hi[p] - pi[p]);
  }
  cout << ans << endl;
}
