import sys

prime=[False]*1000000

for i in range(2,1001):

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

        prime[j]=True



for n in sys.stdin:

    cnt=0

    for i in range(2,int(n)+1):

        if not prime[i]:

            cnt+=1

    print(cnt)


prime=[False]*1000000

for i in range(2,1001):

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

        prime[j]=True



while True:

    try:

        n=int(eval(input()))

    except:

        break

    print((prime[2:n+1].count(False)))
import sys

prime = [False] * 1000000
for i in range(2, 1001):
    for j in range(i * 2, 1000000, i):
        prime[j] = True
for n in sys.stdin:
    cnt = 0
    for i in range(2, int(n) + 1):
        if not prime[i]:
            cnt += 1
    print(cnt)

prime = [False] * 1000000
for i in range(2, 1001):
    for j in range(i * 2, 1000000, i):
        prime[j] = True
while True:
    try:
        n = int(eval(input()))
    except:
        break
    print((prime[2 : n + 1].count(False)))

-import sys - -for n in sys.stdin: -    cnt = 0 -    for i in range(2, int(n) + 1): -        if not prime[i]: -            cnt += 1 -    print(cnt) +while True: +    try: +        n = int(eval(input())) +    except: +        break +    print((prime[2 : n + 1].count(False)))