while n = gets.to_i
  break if n == 0
  sum = Array.new(2) { Array.new(n+1,0) }
  ret = 0
  n.times do |i|
    mtx = gets.split("").map{|s| s == "."}
    n.times do |j|
      sum[1][j+1] = mtx[j] ? [sum[1][j], sum[0][j], sum[0][j+1]].min + 1 : 0
    end
    ret = [ret,sum[1].max].max
    sum.rotate!
  end
  p ret
end