import bisect

import sys

n = 1000000

primes = {i for i in range(3, n, 2)}

for i in range(3, 1000, 2):

    s = {j for j in range(i*2, n, i)}

    primes -= s



primes = [2] + sorted(primes)

for l in sys.stdin:

    print((bisect.bisect(primes, int(l))))
import sys

import math

from bisect import bisect_right

n = 1000000

a = set(range(3, n, 2))

diff = a.difference_update

for i in range(3, int(math.sqrt(n)), 2):

    if i in a:

        diff(list(range(i*2, n+1, i)))



primes = [2] + list(a)

for l in map(int, sys.stdin.readlines()):

    print((bisect_right(primes, l)))
import bisect
import sys

n = 1000000
primes = {i for i in range(3, n, 2)}
for i in range(3, 1000, 2):
    s = {j for j in range(i * 2, n, i)}
    primes -= s
primes = [2] + sorted(primes)
for l in sys.stdin:
    print((bisect.bisect(primes, int(l))))

import sys
import math
from bisect import bisect_right

n = 1000000
a = set(range(3, n, 2))
diff = a.difference_update
for i in range(3, int(math.sqrt(n)), 2):
    if i in a:
        diff(list(range(i * 2, n + 1, i)))
primes = [2] + list(a)
for l in map(int, sys.stdin.readlines()):
    print((bisect_right(primes, l)))

-import bisect +import math +from bisect import bisect_right -primes = {i for i in range(3, n, 2)} -for i in range(3, 1000, 2): -    s = {j for j in range(i * 2, n, i)} -    primes -= s -primes = [2] + sorted(primes) -for l in sys.stdin: -    print((bisect.bisect(primes, int(l)))) +a = set(range(3, n, 2)) +diff = a.difference_update +for i in range(3, int(math.sqrt(n)), 2): +    if i in a: +        diff(list(range(i * 2, n + 1, i))) +primes = [2] + list(a) +for l in map(int, sys.stdin.readlines()): +    print((bisect_right(primes, l)))