import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified Data.Text.Read as T
import Data.List (transpose, group, groupBy)
import Data.Function (on)

main :: IO ()
main = do
  (h : w : _) <- map unsafeSignedDecimal . T.words <$> T.getLine :: IO [Int]
  ss <- sequence . replicate h $ map (== '.') <$> getLine :: IO [[Bool]]
  let
    ss' = map f $ ss
    ss'' = map (maximum . map g . zip . fmap f . unzip) . transpose $ ss'
  print . maximum $ ss''

f :: [Bool] -> [(Int, Bool)]
f = concat . map ((replicate <$> fst <*> id) . ((,) <$> length <*> head)) . group

g :: (Int, (Int, Bool)) -> Int
g (k, (l, True)) = k + l - 1
g _ = 0

unsafeSignedDecimal :: T.Text -> Int
unsafeSignedDecimal s = case T.signed T.decimal s of
  Right (n, _) -> n
