s = gets if s == nil puts 1 exit end c = 1 s.length.times do |i| if s[i] == "L" c = c * 2 else c = c * 2 + 1 end end puts c