N = int(input())

max_q = int(N ** (1 / 3))

primes: list = []

is_prime = [True for _ in range(max_q + 1)]
is_prime[0] = False
is_prime[0] = False
for i in range(2, max_q + 1):
    if is_prime[i]:
        primes.append(i)
        for j in range(i * 2, max_q + 1, i):
            is_prime[j] = False

cnt = 0
for q in primes:
    pmax = min(q - 1, N // q**3)

    l = 0
    h = len(primes) - 1
    while l < h:
        m = (l + h) // 2
        if primes[m] <= pmax:
            l = m + 1
        else:
            h = m

    cnt += l


print(cnt)
