str = gets if str.length<3 then puts "0 0" end str.gsub!("(^^*)","l").gsub!("(*^^)","r") puts "#{str.count("l")} #{str.count("r")}"