require 'prime'

input = Array.new()

while (line = gets) != nil
  input.push(line.to_i)
end

primeGen = Prime::EratosthenesGenerator.new

a = Array.new(999999)
Prime.each(80000) {|i|
  a[i] = 1
}

for n in input

  cnt = 0
  primeGen.rewind
  prime = primeGen.next
  while prime <= n
    if a[prime] != nil
      cnt += 1
    end
    prime = primeGen.next
  end

  p cnt
end