#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>

using namespace std;

void disp_map (vector <vector <int> > m )
{
	int n = m.size();
	int i,j;

	for (i = 0; i < n; ++i){
		for (j = 0; j < n; ++j){
			cout << setw(2) << m[i][j];
		} // end for
		cout << endl;
	} // end for
	cout << endl;
}

int main()
{
	string str = "";

	while (getline (cin, str ) ){
		int n;
		stringstream ssn(str);
		ssn >> n;

		if (n == 0){
			break;
		} // end if	

		vector <vector <int> > dp (n, vector <int> (n, INT_MAX ) );
		
		int i,j;
		for (i = 0; i < n; ++i){
			getline (cin, str );
			for (j = 0; j < str.length(); ++j){
				if (str[j] == '*'){
					dp[i][j] = 0;
				}else if (i == 0 || j == 0){
					dp[i][j] = 1;
				} // end if
			} // end for
		} // end for
	
		for (i = 1; i < n; ++i){
			for (j = 1; j < n; ++j){
				if (dp[i][j] != 0){
					dp[i][j] = min (min (dp[i-1][j], dp[i][j-1]), dp[i-1][j-1] ) + 1;
				} // end if
			} // end for
		} // end for

		int res = 0;
		for (i = 0; i < n*n; ++i){
			if (dp[i/n][i%n] != INT_MAX){
				res = max (res, dp[i/n][i%n]);
			} // end if
		} // end for

		cout << res << endl;

	} // end while 

	return 0;
}