import sys

p=[1]*999999

p[0]=p[1]=0

p[4::2]=[0]*len(p[4::2])

for i in range(3,1000,2):p[i*i::i]=[0]*len(p[i*i::i])

for n in sys.stdin:print(p[0:int(n)+1].count(1))
max_n = 999999

prime_list = [1] * (max_n + 1)



# 0, 1は素数ではない

prime_list[0:2] = [0, 0]



# 

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

    if prime_list[i] == 1:

        prime_list[i**2::i] = [0] * len(prime_list[i**2::i])



while True:

    try:

        n = int(eval(input()))

        print((sum(prime_list[:n + 1])))



    except EOFError:

        break



import sys

p = [1] * 999999
p[0] = p[1] = 0
p[4::2] = [0] * len(p[4::2])
for i in range(3, 1000, 2):
    p[i * i :: i] = [0] * len(p[i * i :: i])
for n in sys.stdin:
    print(p[0 : int(n) + 1].count(1))

max_n = 999999
prime_list = [1] * (max_n + 1)
# 0, 1は素数ではない
prime_list[0:2] = [0, 0]
#
for i in range(2, int(max_n**0.5) + 1):
    if prime_list[i] == 1:
        prime_list[i**2 :: i] = [0] * len(prime_list[i**2 :: i])
while True:
    try:
        n = int(eval(input()))
        print((sum(prime_list[: n + 1])))
    except EOFError:
        break

-import sys - -p = [1] * 999999 -p[0] = p[1] = 0 -p[4::2] = [0] * len(p[4::2]) -for i in range(3, 1000, 2): -    p[i * i :: i] = [0] * len(p[i * i :: i]) -for n in sys.stdin: -    print(p[0 : int(n) + 1].count(1)) +max_n = 999999 +prime_list = [1] * (max_n + 1) +# 0, 1は素数ではない +prime_list[0:2] = [0, 0] +# +for i in range(2, int(max_n**0.5) + 1): +    if prime_list[i] == 1: +        prime_list[i**2 :: i] = [0] * len(prime_list[i**2 :: i]) +while True: +    try: +        n = int(eval(input())) +        print((sum(prime_list[: n + 1]))) +    except EOFError: +        break