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

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

    p b.flatten.compact.max
end

