main = do x <- getLine print $ foldl turn 1 x turn num s | s == 'L' = num * 2 | otherwise = num * 2 + 1