ans = 1 gets.chomp.chars.each do |x| if x=='L' ans *=2 else ans = ans *2 +1 end end puts ans