# Field
module Field
  def self.search_square(grid, x, y)
    max_size = 0
  
    for i in 0...grid.size
      for j in 0...grid[i].size
        size = 0
        stack = []
        stack << grid[i][j]

        until stack.any? { |x| x == '*' }
          size += 1
          break unless i + size < grid.size && j + size < grid[i].size

          stack = []
          stack << grid[i + size][j + size]
          for k in 0...size
            stack << grid[i + k][j + size]
            stack << grid[i + size][j + k]
          end
        end

        max_size = [max_size, size].max
      end
    end

    max_size
  end
end

while line = gets
  n = line.chomp.to_i
  break if n == 0

  grid = []
  n.times do
    grid << gets.chomp.split('')
  end

  puts Field::search_square(grid, 0, 0)
end