import qualified Data.Text.Lazy as T
import qualified Data.Text.Lazy.IO as T
import qualified Data.Text.Lazy.Read as T
import qualified Data.Vector.Unboxed as VU
import qualified Data.Vector as V

main :: IO ()
main = do
  [h, w] <- map unsafeTextToInt . T.words <$> T.getLine :: IO [Int]
  let
    encode :: (Int, Int) -> Int
    encode (i, j) = i * w + j
    decode :: Int -> (Int, Int)
    decode ij = ij `divMod` w
  xs <- VU.fromList . map ('.' ==) . concat . lines <$> getContents :: IO (VU.Vector Bool)
  let
    ls = V.generate (h * w) (f . decode)
      where
        f :: (Int, Int) -> Int
        f ij@(i, j) | not (xs VU.! encode ij) = 0
                    | j == 0                 = 1
                    | otherwise              = ls V.! encode (i, j - 1) + 1
    rs = V.generate (h * w) (f . decode)
      where
        f :: (Int, Int) -> Int
        f ij@(i, j) | not (xs VU.! encode ij) = 0
                    | j == w - 1             = 1
                    | otherwise              = rs V.! encode (i, j + 1) + 1
    us = V.generate (h * w) (f . decode)
      where
        f :: (Int, Int) -> Int
        f ij@(i, j) | not (xs VU.! encode ij) = 0
                    | i == 0                 = 1
                    | otherwise              = us V.! encode (i - 1, j) + 1
    ds = V.generate (h * w) (f . decode)
      where
        f :: (Int, Int) -> Int
        f ij@(i, j) | not (xs VU.! encode ij) = 0
                    | i == h - 1             = 1
                    | otherwise              = ds V.! encode (i + 1, j) + 1
    ys = [max 0 (f (i, j) - 3) | i <- [0 .. (h - 1)], j <- [0 .. (w - 1)]] :: [Int]
      where
        f :: (Int, Int) -> Int
        f (i, j) = ls V.! ij + rs V.! ij + us V.! ij + ds V.! ij
          where
            ij = encode (i, j)
  print . maximum $ ys

unsafeTextToInt :: T.Text -> Int
unsafeTextToInt s = case T.signed T.decimal s of
  Right (n, _) -> n
{-# INLINE unsafeTextToInt #-}
