import Control.Monad (replicateM) main = do [n, m] <- map read . words <$> getLine fs <- replicateM n getLine print $ length $ filter (/='R') $ concat fs