def check(l, n, num)
  ln = 0
  n.times do
    if (l % 2).nonzero?
      ln = 0
    else
      ln += 1
      return true if ln >= num
    end
    l /= 2
  end
  false
end

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 check(l, n, i + 1)
        max = i + 1 if i + 1 > max
      end
    end
  end
  puts max
end
