def solve(n, x, y)
  memo = Array.new(n + 1).fill(true)
  (1..n).each do |l|
    if x + l > n || y + l > n
      (l..n).each do |k|
        memo[k] = false
      end
      break
    end
    (y...y+l).each do |j|
      (x...x+l).each do |i|
        if @data[j][i] == '*'
          (l..n).each do |k|
            memo[k] = false
          end
          break
        end
      end
    end
  end
  memo.rindex(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|
    break if y + maxLength > n
    n.times do |x|
      break if x + maxLength > n
      length = solve(n, x, y)
      maxLength = maxLength < length ? length : maxLength
    end
  end

  p maxLength
end