import qualified Data.Vector as V
import qualified Data.ByteString.Char8 as C
import Data.List





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


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

    yoko <- V.replicateM h C.getLine :: IO (V.Vector C.ByteString)
    let tate = transpose' yoko

    let yokoP = V.map (map C.length . C.group) yoko :: V.Vector [Int]
    let tateP = V.map (map C.length . C.group) tate

    let yokoH = V.zip (V.map ((=='#') . C.head) yoko) yokoP :: V.Vector (Bool,[Int])
    let tateH = V.zip (V.map ((=='#') . C.head) tate) tateP

    let yokoP' = V.map (\(h,xs) -> unwind h xs) yokoH :: V.Vector (V.Vector Int)
    let tateP' = V.map (\(h,xs) -> unwind h xs) tateH

    let tateAsYoko = V.concat $ transpose'' tateP'
    let yokoFin = V.foldl' (V.++) V.empty yokoP'

    let res = V.map pred $ V.zipWith (+) tateAsYoko yokoFin

    print $ V.maximum res




unwind :: Bool -> [Int] -> V.Vector Int
unwind headIsDark xs = let f = if headIsDark then id else tail in 
        V.concat $ zipWith unwAux ((f . cycle) [True,False]) xs


unwAux :: Bool -> Int -> V.Vector Int
unwAux True  c = V.replicate c 0
unwAux False c = V.replicate c c





transpose' :: V.Vector C.ByteString -> V.Vector C.ByteString
transpose' vec
    | V.null vec = V.empty
    | C.null (V.head vec) = V.empty
    | otherwise  = V.foldr C.cons C.empty (V.map C.head vec) `V.cons` (transpose' $ V.map C.tail vec)


transpose'' :: V.Vector (V.Vector Int) -> [V.Vector Int]
transpose'' vec
    | V.null vec = []
    | V.null (V.head vec) = []
    | otherwise  = V.foldr V.cons V.empty (V.map V.head vec) : (transpose'' $ V.map V.tail vec)


