#include <bits/stdc++.h>
using namespace std;
const int M = 340000;
long long f[M], g[M];
long long n;
long long calc(long long n) {
  long long m = 1;
  for (; m * m <= n; m++) f[m] = n / m - 1, g[m] = m - 1;
  g[m] = m - 1;
  long long tmp, v, de;
  for (int i = 2; i <= m; i++) {
    if (g[i] == g[i - 1]) continue;
    v = g[i - 1];
    for (int j = 1, up = min((long long)m - 1, n / i / i); j <= up; j++) {
      tmp = i * j;
      if (tmp < m)
        f[j] -= f[tmp] - v;
      else
        f[j] -= g[n / i / j] - v;
    }
    de = (long long)i * i;
    for (int j = m; j >= de; j--) g[j] -= g[j / i] - v;
  }
  long long re = 0;
  for (int i = 1; i < m; i++)
    if (g[i] != g[i - 1]) re += f[i] - g[i];
  return re;
}
int main() {
  cin >> n;
  long long ans = calc(n);
  cout << ans + g[(int)(pow(n, 1.0 / 3) + 1e-9)] << endl;
  return 0;
}
