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]))



import bisect



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



primes = [i for i, v in enumerate(primes) if v]

while True:

    try:

        n = int(eval(input()))

    except:

        break

    print((bisect.bisect(primes, 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
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]))

import bisect

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
primes = [i for i, v in enumerate(primes) if v]
while True:
    try:
        n = int(eval(input()))
    except:
        break
    print((bisect.bisect(primes, n)))

+import bisect + -answer = [0] * 1000000 -for i in range(2, 1000000): -    answer[i] += primes[i] + answer[i - 1] +primes = [i for i, v in enumerate(primes) if v] -    print((answer[n])) +    print((bisect.bisect(primes, n)))