n  = []

while True:

    try:

        n.append(int(input()))

    except:

        break



R = max(n)+1

p = [1]*R

p[0] = p[1] = 0

i = 2

while i*i <= R:

    if p[i]:

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

    i += p[i+1:].index(1)+1

for i in n:

    print(sum(p[:i+1]))
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]*len(p[2*i::i])

for i in n:

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

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] * len(p[2 * i :: i])
for i in n:
    print(sum(p[: i + 1]))

-i = 2 -while i * i <= R: +p[4::2] = [0 for i in range(4, R, 2)] +for i in range(3, int(R**0.5) + 1, 2): -        p[2 * i :: i] = [0 for x in range(2 * i, R, i)] -    i += p[i + 1 :].index(1) + 1 +        p[2 * i :: i] = [0] * len(p[2 * i :: i])