loop {
    n = gets.to_i
    break if n == 0
    a = (1..n).map{ gets.chomp.split("")}

    square = (1..n).map{ [0] * n }
    (0..n-1).each{|i|
        square[0][i] = (a[0][i] == '.' ? 1 : 0)
        square[i][0] = (a[i][0] == '.' ? 1 : 0)
    }

    max = 0
    (1..n-1).each{|i|
        (1..n-1).each{|j|
            if a[i][j] == '*'
                square[i][j] = 0
            else
                square[i][j] = square[i-1][j-1]
                l = square[i][j-1]
                u = square[i-1][j]
                square[i][j] = l if l < square[i][j]
                square[i][j] = u if u < square[i][j]
                square[i][j] += 1
                max = square[i][j] if square[i][j] > max
            end
        }
    }
    p max
}