import sys

a=[True]*500000

for i in range(3,999,2):

 if a[i//2]:a[(i*i)//2::i]=[False]*len(a[(i*i)//2::i])

for e in map(int,sys.stdin):print(([e-1,sum(a[:(e+1)//2])][e>3]))

import sys

a=[1]*500000

for i in range(3,999,2):

 if a[i//2]:a[(i*i)//2::i]=[0]*len(a[(i*i)//2::i])

[print([e-1,sum(a[:(e+1)//2])][e>3])for e in map(int,sys.stdin)]

import sys

a = [True] * 500000
for i in range(3, 999, 2):
    if a[i // 2]:
        a[(i * i) // 2 :: i] = [False] * len(a[(i * i) // 2 :: i])
for e in map(int, sys.stdin):
    print(([e - 1, sum(a[: (e + 1) // 2])][e > 3]))

import sys

a = [1] * 500000
for i in range(3, 999, 2):
    if a[i // 2]:
        a[(i * i) // 2 :: i] = [0] * len(a[(i * i) // 2 :: i])
[print([e - 1, sum(a[: (e + 1) // 2])][e > 3]) for e in map(int, sys.stdin)]

-a = [True] * 500000 +a = [1] * 500000 -        a[(i * i) // 2 :: i] = [False] * len(a[(i * i) // 2 :: i]) -for e in map(int, sys.stdin): -    print(([e - 1, sum(a[: (e + 1) // 2])][e > 3])) +        a[(i * i) // 2 :: i] = [0] * len(a[(i * i) // 2 :: i]) +[print([e - 1, sum(a[: (e + 1) // 2])][e > 3]) for e in map(int, sys.stdin)]