while gets
  n=$_.to_i
  break if n==0
  mat,max_len=[],0
  n.times do
    mat<<gets.chomp.to_s
  end
  memo=Array.new(n).map{Array.new(n,0)}
  mat.each.with_index(0) do |item, y|
    x=0
    # puts "x:#{x},n:#{n}"
    while x<n
      id,skip=0,0
      # puts "x:#{x},item[#{x}]=#{item[x]}"
      if item[x]=="."
        id=x
        while item[id]=="."
          # puts "id:#{id},item[#{id}]=#{item[id]}"
          skip+=1
          id+=1
        end
        # puts "skip:0..#{skip-1}"
        (0..skip-1).each do |s|
          memo[x+s][y]=skip-s
          # puts " memo[#{y}][#{x+s}]=#{skip-s}"
        end
        x+=skip
      else
        memo[x][y]=0
        # puts " memo[#{y}][#{x}]=0"
        x+=1
      end
    end
  end

  # memo.each do |line|
  #   p line
  # end

  memo.each do |line|
    # puts "line=>#{line}"
    line.each_with_index do |item,x|
      if item>max_len
        cont=true
        if x+item<=n
          # puts "[LOOP(target length)] #{item}times"
          item.times do |m|
            # puts "item=#{item},line[#{x+m}]=#{line[x+m]}"
            break unless cont=(item<=line[x+m])
            # puts "cont:#{cont}"
          end
          max_len=item if cont
          # puts "NEW max_len=#{max_len}" if cont
        end
      end
    end
  end

  p max_len
end