#include<iostream>
#include<string>

#define MAX 1002
using namespace std;

int main(void){
	while( true ){
		int n;
		int maxSize = 0;
		int **map;
		int **sqsz;

		cin >> n;
		
		if( n == 0 ) break;

		map = new int*[n+2];
		sqsz = new int*[n+2];
		for(int i = 0; i < n+2; i++){
			map[i] = new int[n+2];
			sqsz[i] = new int[n+2];
			for(int j = 0; j < n+2; j++){
				map[i][j] = 0;
				sqsz[i][j] = 0;
			}
		}

		for(int i = 0; i < n; i++){
			string s;
			cin >> s;
			for(unsigned int j = 0; j < s.length(); j++){
				if( s[j] == '.' ) map[i+1][j+1] = 1;
			}
		}

		for(int i = n - 1; i >= 0; i--){
			for(int j = n - 1; j >= 0; j--){
				if( map[i+1][j+1] == 1 ){
					sqsz[i+1][j+1] = min(sqsz[i+2][j+1], min(sqsz[i+2][j+2], sqsz[i+1][j+2])) + 1;
					maxSize = max( maxSize, sqsz[i+1][j+1] );
				}
			}
		}
		cout << maxSize << '\n';

		for(int i = 0; i < n+2; i++){
			delete [] map[i];
			delete [] sqsz[i];
		}
		delete [] map;
		delete [] sqsz;

	}
	return 0;
}