road n [] = n road n (x:xs) | x == 'L' = road (2*n) xs | otherwise = road (2*n+1) xs main = do getLine >>= print . road 1