while gets
  n=$_.to_i
  in_list=(3..n).to_a
  in_list.map!{|i| i.odd?}
  prime_list=[2]
  while in_list[0]**2<n
    p = in_list.shift
    prime_list<<p
    in_list.delete_if{|i| i%p==0}
  end
  prime_list+=in_list
  puts prime_list.size
end