
n = 1000000
numberOfPrime = Array.new(n, 0)

#isPrime = Array.new(n, true)
#isPrime[0] = false
#isPrime[0] = false

#def getNumberOfPrime(n)
#
#if n==1 then return 0 end
#if n==2 then return 1 end

lim = Math.sqrt(n)
prime = []
search = (2..n).to_a

tmp = 0
while true

  prime.push(tmp = search.shift)

  search.delete_if{ |i|
    i%tmp==0
  }
  
  if(search.last < prime.max**2)
    prime.concat(search)
    break
  end

end

#prime.each{ |x|
#  numberOfPrime[x] = 1
#}
#prime.sort!

current = 0
count = 0
i = 0
numberOfPrime.map!{
  if(prime[current] == i)
    current += 1
    count += 1
  end
  i += 1
  count
}

#puts numberOfPrime.join(" ")

#return prime.length
#
#end

while STDIN.gets do

n = $_.to_i
puts numberOfPrime[n]

end