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

int main(){
	int n;
	const int smax = 1000;
	string s[smax];
	while(cin >> n){
		if(n == 0) break;
		for(int i = 0; i < n; i++){
			cin >> s[i];
		}
		int c = 0;
		for(int i = 0; i < n; i++){
			for(int j = 0; j < n; j++){
				int count = 0;
				if(s[i][j] == '.'){
					int m = min(n - i, n - j);
					int k = 1;
					while(k < m){
						int a = 0, b = 0;
						while(a<k){
							if(s[i+k][j+a] == '*') break;
							a++;
						}while(b<k){
							if(s[i+b][j+k] == '*') break;
							b++;
						}
						if((a != k || b != k) || s[i+k][j+k] == '*') break;
						k++;
					}
					c = max(c,k);
				}
			}	
		}
		cout << c << endl;
	}
	return 0;
}