let h, w = Scanf.scanf " %d %d" @@ fun a b -> a, b
let ss = Array.init h @@ fun _ -> Scanf.scanf " %s" @@ fun s -> s
let g () = Array.make_matrix h w 0
let us, ds, ls, rs = g (), g (), g (), g ()
let f i j = ss.(i).[j] <> '#'
let ans = ref 0
let _ =
  for i = 0 to h - 1 do
    for j = 0 to w - 2 do if f i j then ls.(i).(j + 1) <- ls.(i).(j) + 1 done done;
  for i = 0 to h - 1 do
    for j = w - 1 downto 1 do if f i j then rs.(i).(j - 1) <- rs.(i).(j) + 1 done done;
  for j = 0 to w - 1 do
    for i = 0 to h - 2 do if f i j then us.(i + 1).(j) <- us.(i).(j) + 1 done done;
  for j = 0 to w - 1 do
    for i = h - 1 downto 1 do if f i j then ds.(i - 1).(j) <- ds.(i).(j) + 1 done done;
  for i = 0 to h - 1 do
    for j = 0 to w - 1 do if f i j then ans := max !ans @@ 1 + us.(i).(j) + ds.(i).(j) + ls.(i).(j) + rs.(i).(j) done done;
  Printf.printf "%d\n" !ans