import math

n = []

while True:

    try:

        n.append(int(input()))

    except:

        break



r = max(n)+1

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



for i in n:

     print(sum(p[:i]))
import math

n = []

while True:

    try:

        n.append(int(input()))

    except:

        break

 

r = max(n)+1

sqrt = int(math.sqrt(r))

p = [1]*r

p[0] = 0

for i in range(1,sqrt):

    if p[i]:

        p[2*i+1::i+1] = [0 for x in range(2*i+1,r,i+1)]

 

for i in n:

     print(sum(p[:i]))
import math

n = []
while True:
    try:
        n.append(int(input()))
    except:
        break
r = max(n) + 1
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
for i in n:
    print(sum(p[:i]))

import math

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

-        for j in range(2 * i + 1, r, i + 1): -            p[j] = 0 +        p[2 * i + 1 :: i + 1] = [0 for x in range(2 * i + 1, r, i + 1)]