str = gets.chomp.split(")") left = str.count("(^^*") right = str.count("(*^^") puts "#{left} #{right}"