cur = 1 (gets || "").chomp.each_char{|c| if c == 'L' cur = cur *2 else cur = cur * 2 + 1 end } puts cur