import sys

import math



N = 1000000

primes = [1] * N

primes[0] = 0

primes[1] = 0

primes[4::2] = [0] * len(primes[4::2])



for i in range(3,int(math.sqrt(N)),2):

    if primes[i]:

        primes[i*i::i*2] = [0] * len(primes[i*i::i*2])



for i in sys.stdin:

        n = int(i)

        print((sum(primes[0:n+1])))
import sys

import math



N = 1000000

primes = [1] * (N//2)

primes[0] = 0



for i in range(3,int(math.sqrt(N)),2):

    if primes[i//2]:

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



for i in sys.stdin:

    n = int(i)

    if n == 1:

        print((0))

    elif n == 2:

        print((1))

    else:

        print((sum(primes[0:(n+1)//2])+1))
import sys
import math

N = 1000000
primes = [1] * N
primes[0] = 0
primes[1] = 0
primes[4::2] = [0] * len(primes[4::2])
for i in range(3, int(math.sqrt(N)), 2):
    if primes[i]:
        primes[i * i :: i * 2] = [0] * len(primes[i * i :: i * 2])
for i in sys.stdin:
    n = int(i)
    print((sum(primes[0 : n + 1])))

import sys
import math

N = 1000000
primes = [1] * (N // 2)
primes[0] = 0
for i in range(3, int(math.sqrt(N)), 2):
    if primes[i // 2]:
        primes[(i * i) // 2 :: i] = [0] * len(primes[(i * i) // 2 :: i])
for i in sys.stdin:
    n = int(i)
    if n == 1:
        print((0))
    elif n == 2:
        print((1))
    else:
        print((sum(primes[0 : (n + 1) // 2]) + 1))

-primes = [1] * N +primes = [1] * (N // 2) -primes[1] = 0 -primes[4::2] = [0] * len(primes[4::2]) -    if primes[i]: -        primes[i * i :: i * 2] = [0] * len(primes[i * i :: i * 2]) +    if primes[i // 2]: +        primes[(i * i) // 2 :: i] = [0] * len(primes[(i * i) // 2 :: i]) -    print((sum(primes[0 : n + 1]))) +    if n == 1: +        print((0)) +    elif n == 2: +        print((1)) +    else: +        print((sum(primes[0 : (n + 1) // 2]) + 1))