# frozen_string_literal: true class Array # rubocop:todo Style/Documentation def solve if empty? 1 else f = pop solve * 2 + f end end end S = gets.chomp.chars.map { |i| i == 'R' ? 1 : 0 } RESULT = S.solve puts RESULT