import sys

m=10**6;a=[0,0]+[1]*m

for i in range(999):

 if a[i]:

  for j in range(i*2,m,i):a[j]=0

for e in sys.stdin:print((sum(a[:int(e)+1])))

import sys

m=10**6;a=[0,0]+[1]*m

for i in range(999):

 if a[i]:a[i*2::i]=[0 for j in a[i*2::i]]

for e in sys.stdin:print((sum(a[:int(e)+1])))

import sys

m = 10**6
a = [0, 0] + [1] * m
for i in range(999):
    if a[i]:
        for j in range(i * 2, m, i):
            a[j] = 0
for e in sys.stdin:
    print((sum(a[: int(e) + 1])))

import sys

m = 10**6
a = [0, 0] + [1] * m
for i in range(999):
    if a[i]:
        a[i * 2 :: i] = [0 for j in a[i * 2 :: i]]
for e in sys.stdin:
    print((sum(a[: int(e) + 1])))

-        for j in range(i * 2, m, i): -            a[j] = 0 +        a[i * 2 :: i] = [0 for j in a[i * 2 :: i]]