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
    while x<n
      id,skip=0,0
      if item[x]=="."
        id=x
        while item[id]=="."
          skip+=1
          id+=1
        end
        (0..skip-1).each do |s|
          memo[x+s][y]=skip-s
        end
        x+=skip
      else
        memo[x][y]=0
        x+=1
      end
    end
  end

  memo.each do |line|
    line.each_with_index do |item,x|
      if item>max_len
        cont=true
        if x+item<=n
          item.times do |m|
            break unless cont=(item<=line[x+m])
          end
          max_len=item if cont
        end
      end
    end
  end
  
  p max_len
end