while gets
  n=$_.to_i
  p_list=Array.new(n+1,1)
  p_list[0..1]=[nil,nil]
  (2..n**(1/2.0)).each do |i|
    if p_list[i]
      (2..n/i).each do |j|
        p_list[i*j]=nil
      end
    end
  end
  puts p_list.compact.size
end