#include <bits/stdc++.h>
using namespace std;
const int N = 500000 + 5;
bool notPri[N];
int pre[N], pri[N];
void Init() {
  notPri[1] = 1;
  for (int i = 2; i * i < N; i++)
    if (!notPri[i])
      for (int j = i * 2; j < N; j += i) notPri[j] = 1;
  for (int i = 2; i < N; i++) {
    if (!notPri[i]) pri[++pri[0]] = i;
    pre[i] = pri[0];
  }
}
const int P = 100000 + 5, Q = 100 + 5;
int f[P][Q];
int Sqrt(long long x) { return floor(sqrt(x)); }
long long F(long long n, int p) {
  if (n < P && p < Q && f[n][p]) return f[n][p];
  long long ans = 0;
  if (p <= 0)
    ans = n - 1;
  else {
    int sqr = pre[Sqrt(n / pri[p])];
    ans = F(n, p - 1) - (F(n / pri[p], min(p - 1, sqr)) - p + 1);
  }
  if (n < P && p < Q) f[n][p] = ans;
  return ans;
}
int main() {
  Init();
  for (int i = 1; i < P; i++) F(i, pre[Sqrt(i)]);
  long long n, cnt = 0;
  cin >> n;
  for (int i = 2; 1LL * i * i * i <= n; i++)
    if (!notPri[i]) cnt++;
  for (int i = 1; i <= pri[0]; i++) {
    int j = pri[i];
    if (1LL * j * j >= n) break;
    cnt += F(n / j, pre[Sqrt(n / j)]) - i;
  }
  cout << cnt;
  return 0;
}
