max = 1000000

candidates = [True for x in range(0, max + 1)]

candidates[0] = False

candidates[1] = False



for i in range(2, max / 2):

    if not candidates[i]:

        continue



    j = i + i

    while True:

        if max < j:

            break

        candidates[j] = False

        j += i



while True:

    try:

        n = int(input())

        print(len([i for i in candidates[0:n+1] if i]))

    except Exception:

        break
import math



max = 1000000

candidates = [True for x in range(0, max + 1)]

candidates[0] = False

candidates[1] = False



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

    if not candidates[i]:

        continue



    j = i + i

    while True:

        if max < j:

            break

        candidates[j] = False

        j += i



while True:

    try:

        n = int(input())

        print(len([i for i in candidates[0:n+1] if i]))

    except Exception:

        break
max = 1000000
candidates = [True for x in range(0, max + 1)]
candidates[0] = False
candidates[1] = False
for i in range(2, max / 2):
    if not candidates[i]:
        continue
    j = i + i
    while True:
        if max < j:
            break
        candidates[j] = False
        j += i
while True:
    try:
        n = int(input())
        print(len([i for i in candidates[0 : n + 1] if i]))
    except Exception:
        break

import math

max = 1000000
candidates = [True for x in range(0, max + 1)]
candidates[0] = False
candidates[1] = False
for i in range(2, int(math.sqrt(max))):
    if not candidates[i]:
        continue
    j = i + i
    while True:
        if max < j:
            break
        candidates[j] = False
        j += i
while True:
    try:
        n = int(input())
        print(len([i for i in candidates[0 : n + 1] if i]))
    except Exception:
        break

+import math + -for i in range(2, max / 2): +for i in range(2, int(math.sqrt(max))):