@data = nil

#正方形が生成できる場合に、最大長を求める
def solve(n, x, y)
  length = 0
  max = n - x + 1

  (2..max).each do |l|
    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[y + (length - 1)][i] == '*'
  end
  #y軸チェック
  (y...y+length).each do |j|
    return false if @data[j][x + (length - 1)] == '*'
  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 |y|
    break if y + length > n
    n.times do |x|
      break if x + length > n
      length = (length < (result = solve(n, x, y)))? result : length if @data[y][x] == '.'
    end
  end

  p length
end