#include<iostream>
#include<string>
using namespace std;

int checkSquare( char *data, int x0, int y0, int n ){
	int d=1;
	while( (x0+d)<=n && (y0+d)<=n ){
		for( int y=y0; y<(y0+d); y++ ){
			for( int x=x0; x<(x0+d); x++ ){
				if( data[y*n+x] == '*' ){
					return d-1;
				}
			}
		}
		d++;
	}
	return d-1;
}

int main(){
	int n;
	char *data;
	string line;
	while(1){
		int max = 0;
		getline( cin, line );
		sscanf( line.c_str(), "%d", &n );
		if( n == 0 )	break;
		data = new char[n*n+1];
		for( int i=0; i<n; i++ ){
			getline( cin, line );
			for( int j=0; j<n; j++ ){
				data[i*n+j] = line[j];
			}
		}
		for( int y=0; y<n; y++ ){
			for( int x=0; x<n; x++ ){
				if( data[y*n+x] == '.' ){
					int l = checkSquare(data,x,y,n);
					max = (max<l) ? l : max;
				}
			}
		}
		cout << max << endl;
		delete[] data;
		data = 0;
	}
	return 0;
}