import math



r = 999999

sqrt = int(math.sqrt(r))

p = [1]*r

p[0] = 0

for i in range(1,sqrt):

    if p[i]:

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

            p[j] = 0



while True:

    try:

        n = int(input())

        print(p[:n].count(1))

    except:

        break
import math



r = 999999

sqrt = int(math.sqrt(r))

p = [1]*r

p[0] = 0

for i in range(1,sqrt):

    if p[i]:

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

            p[j] = 0



while True:

    try:

        n = int(input())

        print(sum(p[:n]))

    except:

        break
import math

r = 999999
sqrt = int(math.sqrt(r))
p = [1] * r
p[0] = 0
for i in range(1, sqrt):
    if p[i]:
        for j in range(2 * i + 1, r, i + 1):
            p[j] = 0
while True:
    try:
        n = int(input())
        print(p[:n].count(1))
    except:
        break

import math

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

-        print(p[:n].count(1)) +        print(sum(p[:n]))