primes = [0, 0] + [1]*999999

for i in range(2, 1001):

    if primes[i]:

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

            primes[j] = 0

while True:

    try:

        data = int(eval(input()))

    except:

        break

    print((sum(1 for i in range(data, 1, -1) if primes[i])))
import bisect

primes = [0, 0] + [1]*999999

for i in range(2, 1001):

    if primes[i]:

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

            primes[j] = 0



primes = [i for i, v in enumerate(primes) if v]

while True:

    try:

        n = int(eval(input()))

    except:

        break

    print((len(primes[:bisect.bisect(primes, n)])))
primes = [0, 0] + [1] * 999999
for i in range(2, 1001):
    if primes[i]:
        for j in range(i * i, 1000001, i):
            primes[j] = 0
while True:
    try:
        data = int(eval(input()))
    except:
        break
    print((sum(1 for i in range(data, 1, -1) if primes[i])))

import bisect

primes = [0, 0] + [1] * 999999
for i in range(2, 1001):
    if primes[i]:
        for j in range(i * i, 1000001, i):
            primes[j] = 0
primes = [i for i, v in enumerate(primes) if v]
while True:
    try:
        n = int(eval(input()))
    except:
        break
    print((len(primes[: bisect.bisect(primes, n)])))

+import bisect + +primes = [i for i, v in enumerate(primes) if v] -        data = int(eval(input())) +        n = int(eval(input())) -    print((sum(1 for i in range(data, 1, -1) if primes[i]))) +    print((len(primes[: bisect.bisect(primes, n)])))