def main
  while (n = gets.to_i) != 0
    array = Array.new(n + 1)
    array[0] = Array.new(n + 1, 0)
    n.times do |i|
      array[i + 1] = [0] + gets.chomp.split(//).map{|c|(c == ".") ? 1:0}
    end
    max = 0
    for x in 1..n
      for y in 1..n
        array[x][y] = [array[x - 1][y - 1], array[x - 1][y], array[x][y - 1]].min + 1 if array[x][y] == 1
        max = (max > array[x][y]) ? max : array[x][y]
      end
    end
    puts max
  end
end
main