import Control.Applicative ((<$>)) main :: IO () main = do solve <$> getLine >>= putStrLn solve :: String -> String solve = f 0 0 where f l r "#" = show l ++ " " ++ show r f l r (x:y:ys) | x == '^' && y == '*' = f (l + 1) r ys | x == '*' && y == '^' = f l (r + 1) ys | otherwise = f l r (y:ys)