n  = []

while True:

    try:n.append(int(input()))

    except:break

R = max(n)+1

p = [1]*R

p[0] = p[1] = 0

p[4::2] = [0 for i in range(4,R,2)]

for i in range(3,int(R**0.5)+1,2):

    if p[i]:

        p[2*i::i] = [0 for j in range(2*i,R,i)]

for i in n:

    print(sum(p[:i+1]))
R = 1000000

p = [1]*R

p[0] = p[1] = 0

p[4::2] = [0 for i in range(4,R,2)]

for i in range(3,int(R**0.5)+1,2):

    if p[i]:

        p[2*i::i] = [0]*len(p[2*i::i])

while True:

    try:print(sum(p[:int(input())+1]))

    except:break
n = []
while True:
    try:
        n.append(int(input()))
    except:
        break
R = max(n) + 1
p = [1] * R
p[0] = p[1] = 0
p[4::2] = [0 for i in range(4, R, 2)]
for i in range(3, int(R**0.5) + 1, 2):
    if p[i]:
        p[2 * i :: i] = [0 for j in range(2 * i, R, i)]
for i in n:
    print(sum(p[: i + 1]))

R = 1000000
p = [1] * R
p[0] = p[1] = 0
p[4::2] = [0 for i in range(4, R, 2)]
for i in range(3, int(R**0.5) + 1, 2):
    if p[i]:
        p[2 * i :: i] = [0] * len(p[2 * i :: i])
while True:
    try:
        print(sum(p[: int(input()) + 1]))
    except:
        break

-n = [] -while True: -    try: -        n.append(int(input())) -    except: -        break -R = max(n) + 1 +R = 1000000 -        p[2 * i :: i] = [0 for j in range(2 * i, R, i)] -for i in n: -    print(sum(p[: i + 1])) +        p[2 * i :: i] = [0] * len(p[2 * i :: i]) +while True: +    try: +        print(sum(p[: int(input()) + 1])) +    except: +        break