#include <iostream>
#include <stack>
#include <algorithm>
#include <cstdio>
#include <sstream>
#include <string>
#include <vector>
#include <cmath>

#define rep(x,to) for(int x=0;x<to;x++)
#define rep2(x,from,to) for(int x=from;x<to;x++)

using namespace std;

int getLargestSquare(int size, vector<string>G){
vector<vector<int> > W(size,vector<int>(size));
char BLOCK = '*';
	
	rep(i,size) {
		W[0][i] = (G[0][i] == BLOCK) ? 0 : 1;
		W[i][0] = (G[i][0] == BLOCK) ? 0 : 1;
	}
	
	int maxWidth = 0;
	rep2(i,1,size){
		rep2(j,1, size){
			if ( G[i][j] == BLOCK ){
				W[i][j] = 0;
			}else{
				W[i][j] = min(W[i-1][j-1], min(W[i-1][j], W[i][j-1])) + 1;
				maxWidth = max( maxWidth, W[i][j] );
			}
		}
	}
	
	return maxWidth;
}



int main(void){

int n;
string ws;
	
	while(cin >> n){
		if(n==0 || cin.eof()) break;
		vector<string> g(n);
		rep(i,n) cin >> g[i];
		cout << getLargestSquare(n,g) << endl; 
	}
	return 0;
	
}