until (n = $<.gets.to_i).zero?
  field = Array.new(n) {$<.gets.chomp}
  field.map! {|st| eval("0b" + st.gsub(/\./, "0").gsub(/\*/, "1"))}
  max = 0
  
  n.times do |y|
    l = field[y]
    break unless n - y > max
    (n - y).times do |i|
      l |= field[y + i]
      if l.to_s(2).rjust(n, "0").include?("0" * (i + 1))
        max = i + 1 if i + 1 > max
      end
    end
  end
  puts max
end
