while True:

    try:

        n = int(eval(input()))

    except:

        break



    a = [0 for i in range(n + 1)]



    # sieve

    i = 3

    while i * i <= n:

        for j in range(3 * i, n + 1, 2 * i): a[j] = 1

        i += 2



    count = int(n >= 2)

    count += sum(a[i] == 0 for i in range(3, n + 1, 2))

    print(count)
a = [True for i in range(1000000)]

i = 3

while i * i < 1000000:

    for j in range(3 * i, 1000000, 2 * i): a[j] = False

    i += 2



while True:

    try:

        n = int(eval(input()))

    except:

        break



    count = int(n >= 2) + sum(a[i] for i in range(3, n + 1, 2))

    print(count)
while True:
    try:
        n = int(eval(input()))
    except:
        break
    a = [0 for i in range(n + 1)]
    # sieve
    i = 3
    while i * i <= n:
        for j in range(3 * i, n + 1, 2 * i):
            a[j] = 1
        i += 2
    count = int(n >= 2)
    count += sum(a[i] == 0 for i in range(3, n + 1, 2))
    print(count)

a = [True for i in range(1000000)]
i = 3
while i * i < 1000000:
    for j in range(3 * i, 1000000, 2 * i):
        a[j] = False
    i += 2
while True:
    try:
        n = int(eval(input()))
    except:
        break
    count = int(n >= 2) + sum(a[i] for i in range(3, n + 1, 2))
    print(count)

+a = [True for i in range(1000000)] +i = 3 +while i * i < 1000000: +    for j in range(3 * i, 1000000, 2 * i): +        a[j] = False +    i += 2 -    a = [0 for i in range(n + 1)] -    # sieve -    i = 3 -    while i * i <= n: -        for j in range(3 * i, n + 1, 2 * i): -            a[j] = 1 -        i += 2 -    count = int(n >= 2) -    count += sum(a[i] == 0 for i in range(3, n + 1, 2)) +    count = int(n >= 2) + sum(a[i] for i in range(3, n + 1, 2))