p gets.chomp.chars.to_a.inject(1){|s,e|e=="L" ? (s*2) : (s*2+1)}