n = 1 gets.chomp.each_char do |c| n = 2 * n n += 1 if c == "R" end puts n