read N P ruby -rprime -e"p $P<2||$P*2>$N&&$P.prime?? 1:$N-1-($N/2+1..$N).count(&:prime?)"