1,'r'=>1,'e'=>2] as $k=>$v){$c[]=floor(substr_count($a,$k)/$v);}echo min($c)."\n";