loop {
	n = gets.to_i
	break if n == 0
	a = (1..n).map{ gets.chomp.split("")}
	
	square = (1..n).map{ [0] * n }
	(0..n-1).each{|i|
		square[0][i] = (a[0][i] == '.' ? 1 : 0)
		square[i][0] = (a[i][0] == '.' ? 1 : 0)
	}
	
	max = 0
	(1..n-1).each{|i|
		(1..n-1).each{|j|
			if a[i][j] == '*'
				square[i][j] = 0
			else
				square[i][j] = [square[i-1][j-1], square[i][j-1], square[i-1][j]].min + 1
			end
			max = [max, square[i][j]].max
		}
	}
	p max
}