

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)))
prime=[True]*1000000

np=[0]*1000000

for i in range(2,1000000):

    if prime[i]:

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

            prime[j]=False

    np[i]=np[i-1]+prime[i]



while True:

    try:

        n=int(eval(input()))

    except:

        break

    print((np[n]))
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)))

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

-prime = [False] * 1000000 -for i in range(2, 1001): -    for j in range(i * 2, 1000000, i): -        prime[j] = True +prime = [True] * 1000000 +np = [0] * 1000000 +for i in range(2, 1000000): +    if prime[i]: +        for j in range(i * 2, 1000000, i): +            prime[j] = False +    np[i] = np[i - 1] + prime[i] -    print((prime[2 : n + 1].count(False))) +    print((np[n]))