use std::cmp;

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        h: usize,
        w: usize,
        board: [chars; h]
    }

    let mut ans = 0;
    let mut vert_dp = vec![vec![0; w]; h];
    let mut horizon_dp = vec![vec![0; w]; h];

    for hi in 0..h {
        for wi in 0..w {
            if board[hi][wi] == '#' {
                continue;
            };

            let mut vert: usize = 0;
            if vert_dp[hi][wi] != 0 {
                vert = vert_dp[hi][wi];
            } else {
                let mut range_min = h;
                let mut range_max = 0;
                for i in hi..h {
                    if board[i][wi] == '#' {
                        break;
                    };
                    vert += 1;
                    range_max = i;
                }
                for i in (0..hi).rev() {
                    if board[i][wi] == '#' {
                        break;
                    };
                    vert += 1;
                    range_min = i;
                }
                for i in range_min..range_max {
                    vert_dp[i][wi] = vert;
                }
            }

            let mut horizon: usize = 0;
            if horizon_dp[hi][wi] != 0 {
                horizon = horizon_dp[hi][wi];
            } else {
                let mut range_min = w;
                let mut range_max = 0;
                for i in wi..w {
                    if board[hi][i] == '#' {
                        break;
                    };
                    horizon += 1;
                    range_max = i;
                }
                for i in (0..wi).rev() {
                    if board[hi][i] == '#' {
                        break;
                    };
                    horizon += 1;
                    range_min = i;
                }
                for i in range_min..range_max {
                    horizon_dp[hi][i] = horizon;
                }
            }

            ans = cmp::max(ans, vert + horizon - 1);
        }
    }
    println!("{}", ans);
}


Measured memory_bytes: 102652