lis=[1 for i in range(int(1e6+1))]



lis[0]=lis[1]=0



for i in range(int(1e6)+1):

    if lis[i]:

        for j in range(i*2,int(1e6+1),i):

            lis[j]=0



while True:

    try:

        n=int(eval(input()))

        cnt=0

        for i in range(n+1):

            if lis[i]:

                cnt+=1



        print(cnt)

        

        

    except:

        break
lis=[True for i in range(int(1e6+1))]



lis[0]=lis[1]=False

end=int(1e6**0.5)

for i in range(end+1):

    if lis[i]:

        for j in range(i*2,int(1e6+1),i):

            lis[j]=False



while True:

    try:

        n=int(eval(input()))

        cnt=0

        for i in range(n+1):

            if lis[i]:cnt+=1

        print(cnt)

        

        

    except EOFError:

        break
lis = [1 for i in range(int(1e6 + 1))]
lis[0] = lis[1] = 0
for i in range(int(1e6) + 1):
    if lis[i]:
        for j in range(i * 2, int(1e6 + 1), i):
            lis[j] = 0
while True:
    try:
        n = int(eval(input()))
        cnt = 0
        for i in range(n + 1):
            if lis[i]:
                cnt += 1
        print(cnt)
    except:
        break

lis = [True for i in range(int(1e6 + 1))]
lis[0] = lis[1] = False
end = int(1e6**0.5)
for i in range(end + 1):
    if lis[i]:
        for j in range(i * 2, int(1e6 + 1), i):
            lis[j] = False
while True:
    try:
        n = int(eval(input()))
        cnt = 0
        for i in range(n + 1):
            if lis[i]:
                cnt += 1
        print(cnt)
    except EOFError:
        break

-lis = [1 for i in range(int(1e6 + 1))] -lis[0] = lis[1] = 0 -for i in range(int(1e6) + 1): +lis = [True for i in range(int(1e6 + 1))] +lis[0] = lis[1] = False +end = int(1e6**0.5) +for i in range(end + 1): -            lis[j] = 0 +            lis[j] = False -    except: +    except EOFError: