primes = [0, 0] + [1] * 999999

for i in range(2, 1000):

    if primes[i]:

        for j in range(i*i, 1000000, i):

            primes[j] = 0



while True:

    try:

        n = int(eval(input()))

    except:

        break

    ans = 0

    while n > 0:

        ans += primes[n]

        n -= 1

    print(ans)



primes = [0, 0] + [1] * 999999

for i in range(2, 1000):

    if primes[i]:

        for j in range(i*i, 1000000, i):

            primes[j] = 0



answer = [0] * 1000000

for i in range(2, 1000000):

    answer[i] += primes[i] + answer[i-1]



while True:

    try:

        n = int(eval(input()))

    except:

        break

    print((answer[n]))



primes = [0, 0] + [1] * 999999
for i in range(2, 1000):
    if primes[i]:
        for j in range(i * i, 1000000, i):
            primes[j] = 0
while True:
    try:
        n = int(eval(input()))
    except:
        break
    ans = 0
    while n > 0:
        ans += primes[n]
        n -= 1
    print(ans)

primes = [0, 0] + [1] * 999999
for i in range(2, 1000):
    if primes[i]:
        for j in range(i * i, 1000000, i):
            primes[j] = 0
answer = [0] * 1000000
for i in range(2, 1000000):
    answer[i] += primes[i] + answer[i - 1]
while True:
    try:
        n = int(eval(input()))
    except:
        break
    print((answer[n]))

+answer = [0] * 1000000 +for i in range(2, 1000000): +    answer[i] += primes[i] + answer[i - 1] -    ans = 0 -    while n > 0: -        ans += primes[n] -        n -= 1 -    print(ans) +    print((answer[n]))