#include <bits/stdc++.h>
using namespace std;
using namespace std;
long long sqrt2(long long x) {
  long long r = (long long)sqrt(x - 0.1);
  while (r * r <= x) ++r;
  return r - 1;
}
long long sqrt3(long long x) {
  long long r = (long long)cbrt(x - 0.1);
  while (r * r * r <= x) ++r;
  return r - 1;
}
const int N = 1e6 + 2;
long long L[N], R[N];
long long getans(long long n) {
  long long rn = sqrt2(n);
  for (long long i = 1; i <= rn; ++i) R[i] = n / i - 1;
  long long ln = n / rn + 1;
  for (long long i = 1; i <= ln; ++i) L[i] = i - 1;
  for (long long p = 2; p <= rn; ++p) {
    if (L[p] == L[p - 1]) continue;
    for (long long i = 1, tn = min(n / (p * p), rn); i <= tn; ++i) {
      R[i] -= (i * p <= rn ? R[i * p] : L[n / (i * p)]) - L[p - 1];
    }
    for (long long i = ln; i >= p * p; --i) {
      L[i] -= L[i / p] - L[p - 1];
    }
  }
  long long ans = L[sqrt3(n)];
  for (long long p = 2; p <= rn; ++p) {
    if (L[p] == L[p - 1]) continue;
    ans += R[p] - L[p];
  }
  return ans;
}
int main() {
  long long n;
  while (cin >> n) {
    cout << getans(n) << endl;
  }
  return 0;
}
