{-# LANGUAGE BangPatterns #-}

import qualified Data.ByteString.Char8 as BS
import Data.Maybe (fromJust)
import Data.List

zipWith' :: (a -> b -> c) -> [a] -> [b] -> [c]
zipWith' f (a:as) (b:bs) = x `seq` x : zipWith' f as bs
  where
    x = f a b
zipWith' _ _ _ = []

countLine :: String -> [Int]
countLine !ln = map (max 0 . pred) $ zipWith' (+) l r
  where
    f :: Int -> Char -> Int
    f a c = if c == '.' then a + 1 else 0
    !l = tail $ scanl' f 0 ln
    !r = init $ scanr (flip f) 0 ln

main :: IO ()
main = do
    [h,w] <- map read . words <$> getLine :: IO [Int]
    a <- map BS.unpack . BS.lines
      <$> BS.getContents :: IO [String]
    let !a1 = map countLine a
        !a2 = transpose . map countLine $ transpose a
        !a3 = zipWith' (zipWith' (+)) a1 a2
    print . pred . maximum $ concat a3 
