while line = gets
  num = line.chomp

  f = Array.new(num.to_i+1)
  f[0] = false

 (num.to_i+1).times do |i|

   if(i == 0)
     next
   end

    ft = i+1
    while ft<=num.to_i+1
      f[ft] = false
      ft = ft + (i+1)
    end
 end

  cnt = 0
  (num.to_i+1).to_i.times do |i|
    if(f[i] == nil)
      cnt = cnt +1
    end
  end

  puts cnt

end