@data = nil

#def solve(n, x, y)
#  #  printf "solve X=%d Y=%d\n", x, y
#  return 0 if @data[y][x] == '*'
#
#  length = 1
#  (n-x).step(2, -1) do |l|
#    #    printf "length=%d", l
#    #    p isSquare(n, x, y ,l)
#    if isSquare(n, x, y ,l)
#      if(length < l)
#        length = l
#      else
#        break
#      end
#    end
#  end
#  length
#end

#def isSquare(n, x, y, length)
#  return false if y + length > n
#
#  (y...y+length).each do |j|
#    (x...x+length).each do |i|
#      if @data[j][i] == '*'
#        return false
#      end
#    end
#  end
#  true
#end

def solve(n, x, y, maxLength)
  return 0 if @data[y][x] == '*'

  length = maxLength
  (x+length...n).each do |i|
    if isSquare(n, x, y ,i - x)
      length = i - x
    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, length))? result : length if @data[y][x] == '.'
    end
  end

  p length
end