import qualified Data.Vector.Unboxed as U
import qualified Data.Vector as V
import qualified Data.ByteString.Char8 as C
import Debug.Trace
import Data.List
import Control.Monad
import Data.Ord




r :: Int -> IO (U.Vector Int)
r n = U.unfoldrN n (C.readInt . C.dropWhile (==' ')) <$> C.getLine

r' :: IO [Int]
r'  =   unfoldr    (C.readInt . C.dropWhile (==' ')) <$> C.getLine

main :: IO ()
main = do
    [h,w] <- r'

    hori <- replicateM h getLine :: IO [String]
    let vert = transpose hori :: [String]

    let numH = map transformV hori :: [U.Vector Int]
    let numV = map U.fromList $ transpose $ map transform vert

    let sumSq = zipWith (U.zipWith (+)) numH numV

    print $ pred $ maximum $ map U.maximum sumSq

transform :: String -> [Int]
transform = concat . map transformG . group

transformV :: String -> U.Vector Int
transformV = U.concat . map (U.fromList . transformG) . group

transformG xxs@(x:xs) = case x of '.' -> replicate (length xxs) (length xxs)
                                  '#' -> replicate (length xxs) 0
