loop do
    h, w = gets.split.map(&:to_i)
    break if h == 0
    input = (1..h).map { gets.chomp.split("") }

    m = 0
    a = Array.new(w).map { Array.new(w) }
    b = Array.new(w).map { Array.new(w, 0) }
    c = Array.new(w).map { Array.new(w) }
    (0..h-1).each do |k|
        (0..w-1).to_a.repeated_combination(2) do |i, j|
            if i == j
                a[i][j] = (input[k][j] == ?. ? 1 : 0)
            elsif input[k][j] == ?. and a[i][j-1] > 0
                a[i][j] = a[i][j-1] + 1
            else
                a[i][j] = 0
            end
        end

        (0..w-1).to_a.repeated_combination(2) do |i, j|
            if a[i][j] > 0
                c[i][j] = b[i][j] + a[i][j]
                m = c[i][j] if c[i][j] > m
            else
                c[i][j] = 0
            end
        end
        b = c
    end

    p m
end

