#include <iostream>

int min3(int x, int y, int z)
{
	if (x>y) return y>z ? z : y;
	else return x>z ? z : x;
}

int main()
{
	while (true) {
		int size;
		std::cin >> size;
		
		if (size==0) break;
		
		std::string* board = new std::string[size];
		for (int i=0; i<size; i++) {
			std::cin >> board[i];
		}
		
		int** max_square_size = new int*[size]; 
		for (int i=0; i<size; i++) {
			max_square_size[i] = new int[size];
		}
		
		int max_size = 0;
		for (int i=size-1; i>=0; i--) {
			for (int j=size-1; j>=0; j--) {
				if (board[i][j] == '*') max_square_size[i][j] = 0;
				else if (i==size-1 || j==size-1) max_square_size[i][j] = 1;
				else if (board[i+1][j] == '*' || board[i][j+1] == '*' || board[i+1][j+1] == '*') max_square_size[i][j] = 1;
				else {
					max_square_size[i][j] = min3(max_square_size[i+1][j], 
						max_square_size[i][j+1], max_square_size[i+1][j+1]) + 1;
				}
				if (max_square_size[i][j] > max_size) {
					max_size = max_square_size[i][j];
				}
			}
		}
		
		for (int i=0; i<size; i++) delete[] max_square_size[i];
		delete[] max_square_size;
		delete[] board;
		
		std::cout << max_size << std::endl;
	}
	
	return 0;
}
	
