main = getLine >>= print . foldl (\acc x -> 2 * acc + if x == 'L' then 0 else 1) 1