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 C.getLine :: IO [C.ByteString]
    let vert = C.transpose hori :: [C.ByteString]

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

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

    print $ pred $ maximum $ map U.maximum sumSq

transform :: C.ByteString -> U.Vector Int
transform = U.concat . map transformG . C.group

transformG bs = case C.head bs of '.' -> U.replicate (C.length bs) (C.length bs)
                                  '#' -> U.replicate (C.length bs) 0


transposeV :: U.Unbox a => [U.Vector a] -> [U.Vector a]
transposeV xs = (U.fromList (map U.head xs)) :(transposeV (map U.tail xs))

