@data = nil

def solve(n, x, y)
  stack = Array.new
  (x+1...n).each do |i|
    break if @data[i][y] == '*'
    stack << (i - x + 1)
  end

  length = 1
  stack.reverse!
  while stack.size > 0 do
    l = stack.pop
    if isSquare(n, x, y ,l)
      length = l
    else
      break
    end
  end
  length
end

def isSquare(n, x, y, length)
  return false if x + length >= n || y + length >= n

  #x軸チェック
  (x...x+length).each do |i|
    return false if @data[i][y + length - 1] == '*'
  end
  #y軸チェック
  (y...y+length).each do |j|
    return false if @data[x + length - 1][j] == '*'
  end
  
  true

end

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

  length = 0
  n.times do |x|
    break if x + length > n
    n.times do |y|
      break if y + length> n
      length = [length, solve(n, x, y)].max if @data[x][y] == '.'
    end
  end

  p length
end