n = gets.chomp ans = 1 n.each_char do |c| if(c=="L") ans *= 2 else ans += ans + 1 end end p ans