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)))
def get_prime_set(ub):

    from itertools import chain

    from math import sqrt



    if ub < 4:

        return ({}, {}, {2}, {2, 3})[ub]



    ub, ub_sqrt = ub+1, int(sqrt(ub))+1

    primes = {2, 3} | set(chain(range(5, ub, 6), range(7, ub, 6)))

    du = primes.difference_update

    for n in chain(range(5, ub_sqrt, 6), range(7, ub_sqrt, 6)):

        if n in primes:

            du(range(n*3, ub, n*2))



    return primes





import sys

from bisect import bisect_right

primes = list(get_prime_set(999999))

print(*(bisect_right(primes, int(n)) for n in sys.stdin), sep="\n")

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)))

def get_prime_set(ub):
    from itertools import chain
    from math import sqrt

    if ub < 4:
        return ({}, {}, {2}, {2, 3})[ub]
    ub, ub_sqrt = ub + 1, int(sqrt(ub)) + 1
    primes = {2, 3} | set(chain(range(5, ub, 6), range(7, ub, 6)))
    du = primes.difference_update
    for n in chain(range(5, ub_sqrt, 6), range(7, ub_sqrt, 6)):
        if n in primes:
            du(range(n * 3, ub, n * 2))
    return primes


import sys
from bisect import bisect_right

primes = list(get_prime_set(999999))
print(*(bisect_right(primes, int(n)) for n in sys.stdin), sep="\n")

+def get_prime_set(ub): +    from itertools import chain +    from math import sqrt + +    if ub < 4: +        return ({}, {}, {2}, {2, 3})[ub] +    ub, ub_sqrt = ub + 1, int(sqrt(ub)) + 1 +    primes = {2, 3} | set(chain(range(5, ub, 6), range(7, ub, 6))) +    du = primes.difference_update +    for n in chain(range(5, ub_sqrt, 6), range(7, ub_sqrt, 6)): +        if n in primes: +            du(range(n * 3, ub, n * 2)) +    return primes + + -import math -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))) +primes = list(get_prime_set(999999)) +print(*(bisect_right(primes, int(n)) for n in sys.stdin), sep="\n")