#include<iostream>
#include<string>

#define N 1000

using namespace std;

int main(){

	int n, cnt, m, x, a[N][N];
	string str;
	
	while(cin >> n){
		if(n == 0) break;
		
		m = 0;
		
		for(int i=0; i<n; i++){
			cnt = 1;
			cin >> str;
			for(int j=n-1; j>=0; j--){
				if(str[j] == '.'){
					a[i][j] = cnt;
					cnt++;
				}
				else {
					a[i][j] = 0;
					cnt = 1;
				}
			}
		}
		
		for(int i=0; i<n; i++){
			for(int j=0; j<n; j++){
				x = a[i][j];
				if(a[i][j] != 0){
					for(int k=1; k<a[i][j]; k++){
						if(a[i+k][j] == 0 || k > x){
							x = k-1;
							break;
						}
						else if(x > a[i+k][j]){
							x = max(k-1, a[i+k][j]);
						}
					}
					m = max(m, x);
				}
			}
		}
		
		cout << m << endl;
		
	}

	return 0;

}