import math



r = 999999

sqrt = int(math.sqrt(r))

prime = [1 for i in range(r)]

prime[0] = 0

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

    prime[2*i-1] = 0

for i in range(3,sqrt,2):

    mx = 2*i

    while mx <= r:

        prime[mx-1] = 0

        mx += i



while True:

    try:

        n = int(input())

        print(sum(prime[:n]))

    except:

        break
import math



r = 999999

sqrt = int(math.sqrt(r))

prime = [1 for i in range(r)]

prime[0] = 0

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

    prime[2*i-1] = 0

for i in range(3,sqrt,2):

    for j in range(2*i,r+1,i):

        prime[j-1] = 0



while True:

    try:

        n = int(input())

        print(sum(prime[:n]))

    except:

        break
import math

r = 999999
sqrt = int(math.sqrt(r))
prime = [1 for i in range(r)]
prime[0] = 0
for i in range(2, r / 2):
    prime[2 * i - 1] = 0
for i in range(3, sqrt, 2):
    mx = 2 * i
    while mx <= r:
        prime[mx - 1] = 0
        mx += i
while True:
    try:
        n = int(input())
        print(sum(prime[:n]))
    except:
        break

import math

r = 999999
sqrt = int(math.sqrt(r))
prime = [1 for i in range(r)]
prime[0] = 0
for i in range(2, r / 2):
    prime[2 * i - 1] = 0
for i in range(3, sqrt, 2):
    for j in range(2 * i, r + 1, i):
        prime[j - 1] = 0
while True:
    try:
        n = int(input())
        print(sum(prime[:n]))
    except:
        break

-    mx = 2 * i -    while mx <= r: -        prime[mx - 1] = 0 -        mx += i +    for j in range(2 * i, r + 1, i): +        prime[j - 1] = 0