#include <bits/stdc++.h>
const int K = 10000000;
const int P = 1000000;
int lp[K], lp_ind[K], first[K], ind[K], ord[K], amt[P], b[K];
long long n;
std::vector<int> pr;
std::map<std::pair<int, int>, int> st;
std::map<std::pair<long long, int>, long long> m;
void sieve() {
  for (int i = 2; i < K; ++i) {
    if (!lp[i]) {
      lp[i] = i;
      lp_ind[i] = (int)pr.size();
      pr.push_back(i);
    }
    for (int j = 0; j < (int)pr.size() && pr[j] <= lp[i] && i * pr[j] < K;
         ++j) {
      lp[i * pr[j]] = pr[j];
      lp_ind[i * pr[j]] = j;
    }
  }
}
int find_rt(long long n) {
  int l = 0, r = (int)pr.size(), ans;
  while (l < r) {
    int m = (l + r) >> 1;
    if ((long long)pr[m] * pr[m] > n) {
      ans = m;
      r = m;
    } else
      l = m + 1;
  }
  return ans;
}
long long dp(long long n, int k) {
  if (!k) return n;
  if ((long long)pr[k - 1] * pr[k - 1] > n && (long long)pr[k] * pr[k] > n) {
    int rt = find_rt(n);
    return dp(n, rt) + rt - k;
  }
  if (n < K) return st[std::make_pair(n, k)];
  if (m.count(std::make_pair(n, k))) return m[std::make_pair(n, k)];
  return m[std::make_pair(n, k)] = dp(n, k - 1) - dp(n / pr[k - 1], k - 1);
}
void add(int i) {
  while (i < K) {
    ++b[i];
    i |= i + 1;
  }
}
int get(int i) {
  int s = 0;
  while (i > 0) {
    s += b[i];
    i = (i & i + 1) - 1;
  }
  return s;
}
void answer() {
  amt[0] = 1;
  for (int i = 1; i < K; ++i)
    if (lp_ind[i] != (int)pr.size() - 1) ++amt[lp_ind[i] + 1];
  for (int i = 1; i < (int)pr.size(); ++i) amt[i] += amt[i - 1];
  for (int i = 1; i < K; ++i) ord[amt[lp_ind[i]]++] = i;
  ind[1] = K;
  for (int i = 2, j = 0; i < K; ++i) {
    if (pr[j] < lp[ord[i]]) {
      ++j;
      first[j] = i;
    }
    ind[ord[i]] = i;
  }
  int cur = 0;
  for (std::map<std::pair<int, int>, int>::iterator it = st.begin();
       it != st.end(); ++it) {
    while (cur < it->first.first) {
      ++cur;
      add(ind[cur]);
    }
    it->second = cur - get(first[it->first.second] - 1);
  }
}
long long pi(long long n) {
  int rt = find_rt(n);
  return dp(n, rt) + rt - 1;
}
int main() {
  scanf("%lld", &n);
  sieve();
  long long ans;
  for (ans = 0; (long long)pr[ans] * pr[ans] * pr[ans] <= n; ++ans)
    ;
  for (int i = 0; (long long)pr[i] * pr[i] < n; ++i) pi(n / pr[i]);
  answer();
  m.clear();
  for (int i = 0; (long long)pr[i] * pr[i] < n; ++i)
    ans += pi(n / pr[i]) - i - 1;
  printf("%lld\n", ans);
  return 0;
}
