> File Name: 665F.cpp
> Author: jiangyuzhu
> Mail: 834138558@qq.com
> Created Time: 2016/9/22 21:33:49
************************************************************************/
#include<iostream>
#include<cstdio>
#include<cstring>
#include<queue>
#include<vector>
#include<set>
#include<map>
#include<cmath>
#include<algorithm>
using namespace std;
typedef long long ll;
const int maxn = 1e6 + 5;
const ll maxm = 1e11;
const ll maxp = sqrt(maxm) + 10;
ll f[maxp],g[maxp];
bool isprime[maxn];
int prime[maxn];
int tot = 0;
void init()
{
for(int i = 2; i < maxn; i ++) isprime[i] = true;
for(int i = 2; i < maxn; i++){
if(isprime[i]) prime[tot++] = i;
for(int j = 0; j < tot && i * prime[j] < maxn; j++){
isprime[i * prime[j]] = false;
if(i % prime[j] == 0) break;
}
}
}
ll solve(ll n)
{
ll i,j,m;
for(m = 1; m * m <= n; m++) f[m] = n/m - 1;
for(i = 1;i <= m; i++) g[i] = i-1;
for(i = 2; i <= m; i++){
if(g[i] == g[i-1]) continue;
for(j = 1; j <= min(m - 1, n/i/i); j++){
if(i * j < m) f[j] -= f[i * j] - g[i - 1];
else f[j] -= g[n/i/j] - g[i-1];
}
for(j = m;j >= i * i; j--) g[j] -= g[j / i] - g[i - 1];
}
ll ans = 0;
for(int i = 2; i < m; i++){
if(g[i] == g[i - 1]) continue;
ans += f[i] - g[i];
}
return ans;
}
int main (void)
{
init();
ll n;scanf("%I64d", &n);
ll ans = 0;
for(int i = 0; i < tot; i++){
if(prime[i] * 1LL * prime[i] * prime[i] > n) break;
ans++;
}
printf("%I64d\n", ans + solve(n));
return 0;
}