str = gets puts "#{str.count("^*")} " " #{str.count("*^")}"