def solve(n, x, y)
  length = 0
  (n-x).step(1, -1) do |l|
#    printf "check length:%d\n", l
    if isSquare(n, x, y, l) then
      length = l
#      printf "update:%d\n", l
      break
    end
  end
#  printf "return:%d\n", length
  length
end

def isSquare(n, x, y, length)
  #升目を超える場合は正方形ではない
  return false if x + length - 1 >= n
  return false if y + length - 1 >= n
  
  #正方形に＊があるか確認する
  (y...y+length).each do |j|
    (x...x+length).each do |i|
      return false if @data[j][i] == '*'
    end
  end
  true
end

while (n = $stdin.gets.to_i) != 0 do
  @data = Array.new
  n.times do
    @data << $stdin.gets.chomp
  end

  maxLength = 0
  n.times do |y|
    n.times do |x|
      length = solve(n, x, y)
      maxLength = maxLength < length ? length : maxLength
    end
  end

  p maxLength
end