#include<iostream>
#include<string>

#define MAX 1002
using namespace std;

int main(void){
	while( true ){
		int n;
		int maxSize = 0;
		int line[MAX];
		int sqsz[2][MAX] = {{0,},};

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

		for(int i = 0; i < n; i++){
			string s;
			cin >> s;
			for(unsigned int j = 0; j < s.length(); j++){
				if( s[j] == '.' ){
					line[j+1] = 1;
					if( i == 0 ) sqsz[1][j + 1] = 1;
				}else{
					line[j+1] = 0;
					sqsz[1][j + 1] = 0;
				}
			}
			if(i > 0){
				for(int j = 0; j < n; j++){
					if( line[j + 1] ){
						sqsz[1][j+1] = min(sqsz[0][j+1], min(sqsz[0][j], sqsz[1][j])) + 1;
						maxSize = max( maxSize, sqsz[1][j+1] );
					}
				}
			}
			for(int j = 0; j < n+2; j++) sqsz[0][j] = sqsz[1][j];
		}
		cout << maxSize << '\n';
	}
	return 0;
}