let () =
    let main () =
        let h, w = Scanf.sscanf (read_line ()) "%d %d" (fun h w -> h, w) in
        let s = Array.init h (fun _ -> read_line ()) in
        let mat1 = Array.make_matrix h w 0 in
        let mat2 = Array.make_matrix h w 0 in
        let mat3 = Array.make_matrix h w 0 in
        let mat4 = Array.make_matrix h w 0 in
        for y = 0 to h - 1 do
            let rec loop x acc =
                if x < w then (
                    mat1.(y).(x) <- acc;
                    let acc = if s.(y).[x] = '#' then 0 else acc + 1 in
                    loop (x + 1) acc
                )
            in
            loop 0 0;
            let rec loop x acc =
                if x >= 0 then (
                    mat2.(y).(x) <- acc;
                    let acc = if s.(y).[x] = '#' then 0 else acc + 1 in
                    loop (x - 1) acc
                )
            in
            loop (w - 1) 0;
        done;
        for x = 0 to w - 1 do
            let rec loop y acc =
                if y < h then (
                    mat3.(y).(x) <- acc;
                    let acc = if s.(y).[x] = '#' then 0 else acc + 1 in
                    loop (y + 1) acc
                )
            in
            loop 0 0;
            let rec loop y acc =
                if y >= 0 then (
                    mat4.(y).(x) <- acc;
                    let acc = if s.(y).[x] = '#' then 0 else acc + 1 in
                    loop (y - 1) acc
                )
            in
            loop (h - 1) 0;
        done;
        let rec loop_y y acc =
            let rec loop_x x acc =
                if x = w then acc else
                    if s.(y).[x] = '#' then loop_x (x + 1) acc else
                        let acc = max acc (1 + mat1.(y).(x) + mat2.(y).(x) + mat3.(y).(x) + mat4.(y).(x)) in
                        loop_x (x + 1) acc
            in
            if y = h then acc else loop_y (y + 1) (loop_x 0 acc)
        in
        Printf.printf "%d\n" (loop_y 0 0)
    in
    main ()