print((function(f, s) return f(s) end)(function (s) local r = 1 s:gsub(".", function (e) r = e == "L" and r*2 or r*2+1 end) return r end, io.stdin:read("*l")))