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