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
def sieve(n):

    p=[True for i in range(n+1)]

    p[0]=p[1]=False

    end=int(n**0.5)



    for i in range(2,end+1):

        if p[i]:

            for j in range(i*i,n+1,i):

                p[j]=False



    return p



def solve(n):

    if n<2:return 0

    cnt=1

    for i in range(3,n+1,2):

        if p[i]:cnt+=1



    return cnt



p=sieve(int(1e6))



while True:

    try:

        n=int(eval(input()))

        print((solve(n)))

    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

def sieve(n):
    p = [True for i in range(n + 1)]
    p[0] = p[1] = False
    end = int(n**0.5)
    for i in range(2, end + 1):
        if p[i]:
            for j in range(i * i, n + 1, i):
                p[j] = False
    return p


def solve(n):
    if n < 2:
        return 0
    cnt = 1
    for i in range(3, n + 1, 2):
        if p[i]:
            cnt += 1
    return cnt


p = sieve(int(1e6))
while True:
    try:
        n = int(eval(input()))
        print((solve(n)))
    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 +def sieve(n): +    p = [True for i in range(n + 1)] +    p[0] = p[1] = False +    end = int(n**0.5) +    for i in range(2, end + 1): +        if p[i]: +            for j in range(i * i, n + 1, i): +                p[j] = False +    return p + + +def solve(n): +    if n < 2: +        return 0 +    cnt = 1 +    for i in range(3, n + 1, 2): +        if p[i]: +            cnt += 1 +    return cnt + + +p = sieve(int(1e6)) -        cnt = 0 -        for i in range(n + 1): -            if lis[i]: -                cnt += 1 -        print(cnt) -    except EOFError: +        print((solve(n))) +    except: