while gets
  n=$_.to_i
  break if n==0
  mat,max_len=[],1
  n.times do
    mat<<gets.chomp.to_s
  end

  if mat.uniq.join.gsub("*","").empty?
    p 0
  else
    mat.each.with_index(0) do |item, id1|
      item.each_char.with_index(0) do |w, id2|
        len=0
        if w=="."
          x,y=id2,id1
          while item[id2]=="."
            len+=1
            id2+=1
          end
          (0..len-1).each do |step|
            cont=true
            if y+step<n and step+1>max_len
              (y..y+step).each do |i|
                (x..x+step).each do |j|
                    cont=false if mat[i][j]!="."
                  break unless cont
                end
                break unless cont
              end
              break unless cont
              max_len=step+1 if cont
            else
              cont=false
            end
          end
        end
      end
    end
    p max_len
  end
end