s = gets.chomp ans1 = 0 ans2 = 0 0.step(s.size - 2, 5) do |i| if s[i, 5] == "(^^*)" ans1 += 1 else ans2 += 1 end end puts "#{ans1} #{ans2}"