def solve(n)
  memo = count(n)
  max = 0
  (n-1).step(max - 1, -1) do |y|
#    break if y - max < 0
    (n-1).step(max - 1, -1) do |x|
#      break if x - max < 0
      n.step(max, -1) do |w|
        next if x - w + 1 < 0 || y - w + 1 < 0
        if isSquare(memo, x, y, w)
          max = (max < w)? w : max
        end
      end
    end
  end
  max
end

def isSquare(memo, x, y, w)
  s = memo[y + 1][x + 1] - memo[y + 1 - w][x + 1] - memo[y + 1][x + 1- w] + memo[y + 1 - w][x + 1 - w]
  s == w * w
end

def count(n)
  result = Array.new(n + 1).map{Array.new(n + 1).fill(0)}
  (n+1).times do |y|
    next if y == 0
    count = 0
    (n+1).times do |x|
      next if x == 0
      count += 1 if @data[y - 1][x - 1] == '.'
      result[y][x] = count + result[y - 1][x]
    end
  end
  result
end

while input = $stdin.gets do
  @data = Array.new
  n = input.to_i
  break if n == 0
  n.times do |y|
    @data << $stdin.gets.chomp.split("")
  end
  p solve(n)
end