def sieve(n):

    prime = [True] * n

    prime[0] = prime[1] = False

    for i in range(2, int(n ** 0.5) + 1):

        if prime[i]:

            for j in range(i * i, n, i):

                prime[j] = False

    return [i for i in range(2, n) if prime[i]]



while 1:

    try:

        print(len(sieve(eval(input()) + 1)))

    except:

        break
from bisect import bisect





def sieve(n):

    prime = [True] * n

    prime[0] = prime[1] = False

    for i in range(2, int(n ** 0.5) + 1):

        if prime[i]:

            for j in range(i * i, n, i):

                prime[j] = False

    return [i for i in range(2, n) if prime[i]]



primes = sieve(999999)

while 1:

    try:

        print(bisect(primes, eval(input())))

    except:

        break
def sieve(n):
    prime = [True] * n
    prime[0] = prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if prime[i]:
            for j in range(i * i, n, i):
                prime[j] = False
    return [i for i in range(2, n) if prime[i]]


while 1:
    try:
        print(len(sieve(eval(input()) + 1)))
    except:
        break

from bisect import bisect


def sieve(n):
    prime = [True] * n
    prime[0] = prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if prime[i]:
            for j in range(i * i, n, i):
                prime[j] = False
    return [i for i in range(2, n) if prime[i]]


primes = sieve(999999)
while 1:
    try:
        print(bisect(primes, eval(input())))
    except:
        break

+from bisect import bisect + + +primes = sieve(999999) -        print(len(sieve(eval(input()) + 1))) +        print(bisect(primes, eval(input())))