s = gets.chomp l = s.length ans = 1 l.times do |i| if s[i] == "L" ans *= 2 else ans = ans * 2 + 1 end end puts ans