import sys

 

 

xx = 500000

f = [0, 1] * xx

 

i = 3

while i * i <= 2 * xx:

    if f[i] == 1:

        j = i * i

        while j <= 2 * xx:

            f[j] = 0

            j += i + i

    i += 2

 

f.pop(0)

f.pop(1)

 

for n in sys.stdin:

    i = int(n)

    if i < 2:

        print((0))

    else:

        print((sum(f[:i - 1])))
import sys

 

 

f = [0, 1] * 500000

 

i = 3

while i <= 1000:

    if f[i] == 1:

        j = i * i

        while j <= 1000000:

            f[j] = 0

            j += i + i

    i += 2

 

f.pop(0)

f.pop(1)

 

for n in sys.stdin:

    i = int(n)

    if i < 2:

        print((0))

    else:

        print((sum(f[:i - 1])))
import sys

xx = 500000
f = [0, 1] * xx
i = 3
while i * i <= 2 * xx:
    if f[i] == 1:
        j = i * i
        while j <= 2 * xx:
            f[j] = 0
            j += i + i
    i += 2
f.pop(0)
f.pop(1)
for n in sys.stdin:
    i = int(n)
    if i < 2:
        print((0))
    else:
        print((sum(f[: i - 1])))

import sys

f = [0, 1] * 500000
i = 3
while i <= 1000:
    if f[i] == 1:
        j = i * i
        while j <= 1000000:
            f[j] = 0
            j += i + i
    i += 2
f.pop(0)
f.pop(1)
for n in sys.stdin:
    i = int(n)
    if i < 2:
        print((0))
    else:
        print((sum(f[: i - 1])))

-xx = 500000 -f = [0, 1] * xx +f = [0, 1] * 500000 -while i * i <= 2 * xx: +while i <= 1000: -        while j <= 2 * xx: +        while j <= 1000000: