#include <bits/stdc++.h>
using namespace std;
long long b[320000], ans;
int a[320000], v;
double inv[320000];
void prime(long long N) {
  for (int i = 1; i <= v; ++i) a[i] = i, b[i] = N / i, inv[i] = 1.0 / i;
  for (int p = 2; p <= v; ++p)
    if (a[p] != a[p - 1]) {
      int c = a[p - 1], e = min(N / p / p, (long long)v);
      for (int i = 1; i * p <= v; ++i) b[i] -= b[i * p] - c;
      double m = N / p;
      for (int i = v / p + 1; i <= e; ++i)
        b[i] -= a[(int)(m * inv[i] + 1e-8)] - c;
      if (p <= v / p)
        for (int i = v; i >= p * p; --i)
          a[i] -= a[(int)(i * inv[p] + 1e-8)] - c;
    }
}
int main() {
  long long N;
  cin >> N;
  v = sqrt(N);
  prime(N);
  ans = a[(int)(pow(N, 1.0 / 3) + 1e-8)];
  for (int p = 2; p <= v; ++p)
    if (a[p] != a[p - 1]) ans += b[p];
  cout << ans - a[v] * (a[v] + 1) / 2;
  return 0;
}
