# Here your code ! s = gets.chomp x = 1 l = 0 r = 0 while(x < s.size) if(s[x] == "^") l += 1 else r += 1 end x += 5 end puts "#{l} #{r}"