{-# LANGUAGE OverloadedStrings, ViewPatterns #-}
import Control.Arrow
import Control.Monad
import Data.List
import qualified Data.ByteString.Char8 as B
import qualified Data.Vector as V 
main :: IO ()
main = readLine >>= main'
    where
        main' [h, w] = replicateM h B.getLine >>= print . solve h w 

solve :: Int -> Int -> [B.ByteString] -> Int
solve h w ss = maximum [count i j | i <- [0..(h - 1)], j <- [0..(w - 1)]]
    where
        count i j = hs V.! i V.! j + ws V.! j V.! i - 1

        vs = V.fromList ss

        hs = V.fromList $ map counth ss
        
        counth s = V.fromList $ check 0 0
            where
                check p i
                    | i == w - 1 && c == '#' = replicate (i - p) (i - p) ++ [0]
                    | i == w - 1 = replicate (i - p + 1) (i - p + 1)
                    | c == '#' = replicate (i - p) (i - p) ++ 0 : check (i + 1) (i + 1)
                    | otherwise = check p $ i + 1
                    where
                        c = B.index s i

        ws = V.fromList $ map countw [0..(w - 1)]
        
        countw idx = V.fromList $ check 0 0
            where
                check p i 
                    | i == h - 1 && c == '#' = replicate (i - p) (i - p) ++ [0]
                    | i == h - 1 = replicate (i - p + 1) (i - p + 1)
                    | c == '#' = replicate (i - p) (i - p) ++ 0 : check (i + 1) (i + 1)
                    | otherwise = check p $ i + 1
                    where
                        c = B.index (vs V.! i) idx
        
readLine :: IO [Int]
readLine = unfoldr (fmap (second (maybe B.empty snd . B.uncons)) . B.readInt) <$> B.getLine

readContents :: Int -> IO [[Int]]
readContents = flip replicateM readLine