import sys

n=10**6

s=[True]*n

s[0]=False

s[1]=False

for x in range(2, int(n**0.5)+1):

    if s[x]:

        for i in range(x+x,n,x):

            s[i]=False

for x in sys.stdin.readlines():

    x=int(x)+1

    cnt=0

    for i in range(x):

        if s[i]:

            cnt=cnt+1

    print(cnt)
import sys

n=10**6

p=[1]*n

p[0],p[1]=0,0

for i in range(2,int(n**0.5)+1):

    if p[i]==1:

        for j in range(i**2,n,i):

            p[j]=0

for i in range(2,n):

    p[i]+=p[i-1]

for line in sys.stdin.readlines():

    print(p[int(line)])
import sys

n = 10**6
s = [True] * n
s[0] = False
s[1] = False
for x in range(2, int(n**0.5) + 1):
    if s[x]:
        for i in range(x + x, n, x):
            s[i] = False
for x in sys.stdin.readlines():
    x = int(x) + 1
    cnt = 0
    for i in range(x):
        if s[i]:
            cnt = cnt + 1
    print(cnt)

import sys

n = 10**6
p = [1] * n
p[0], p[1] = 0, 0
for i in range(2, int(n**0.5) + 1):
    if p[i] == 1:
        for j in range(i**2, n, i):
            p[j] = 0
for i in range(2, n):
    p[i] += p[i - 1]
for line in sys.stdin.readlines():
    print(p[int(line)])

-s = [True] * n -s[0] = False -s[1] = False -for x in range(2, int(n**0.5) + 1): -    if s[x]: -        for i in range(x + x, n, x): -            s[i] = False -for x in sys.stdin.readlines(): -    x = int(x) + 1 -    cnt = 0 -    for i in range(x): -        if s[i]: -            cnt = cnt + 1 -    print(cnt) +p = [1] * n +p[0], p[1] = 0, 0 +for i in range(2, int(n**0.5) + 1): +    if p[i] == 1: +        for j in range(i**2, n, i): +            p[j] = 0 +for i in range(2, n): +    p[i] += p[i - 1] +for line in sys.stdin.readlines(): +    print(p[int(line)])