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

inline int length(string s){
	int lmax = 0;
	int count = 0;
	for(string::const_iterator iter = s.begin();
		iter != s.end(); iter++)
	{
		if(*iter == '.'){
			count++;
		}else{
			lmax = max(lmax,count);
			count = 0;
		}
	}
	return max(lmax,count);
}

bool find_s(string s[1000], int i, int n){
	for(int j = 0; j <= n - i; j++){
		if(length(s[i]) >= i){
			for(int k = 0; k <= n - i; k++){
				if(s[j][k] == '.'){
					int count = 0;
					int l = 0, m = 0;
					while(count == 0 && l < i){
						while(count == 0 && m < i){
							if(s[j+l][k+m] == '*') count++;
							m++;
						}
						l++;
					}
					if(count == 0) return true;
				}
			}
		}
	}
	return false;
}

int main(){
	int n;
	const int max = 1000;
	string s[max];
	while(cin >> n){
		if(n == 0) break;
		for(int i = 0; i < n; i++){
			cin >> s[i];
		}
		int c = 0;
		for(int i = n; i > 0; i--){
			if(find_s(s,i,n)){
				c = i;
				break;
			}	
		}
		cout << c << endl;
	}
	return 0;
}