#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>	// require sort next_permutation count __gcd reverse etc.
#include <cstdlib>	// require abs exit atof atoi 
#include <cstdio>		// require scanf printf
#include <functional>
#include <numeric>	// require accumulate
#include <cmath>		// require fabs
#include <climits>
#include <limits>
#include <cfloat>
#include <iomanip>	// require setw
#include <sstream>	// require stringstream 
#include <cstring>	// require memset
#include <cctype>		// require tolower, toupper
#include <fstream>	// require freopen
#include <ctime>		// require srand
#define rep(i,n) for(int i=0;i<(n);i++)
#define ALL(A) A.begin(), A.end()

using namespace std;

typedef long long ll;
typedef pair<int, int> P;
char grid[1005][1005];
int dp[1005][1005];

void disp_grid (int n )
{
	cout << "grid: " << endl;
	rep (i, n ){
		rep (j, n ){
			cout << grid[i][j];
		} // end rep
		cout << endl;
	} // end rep
}
void disp_dp (int n )
{
	cout << "dp: " << endl;
	rep (i, n ){
		rep (j, n ){
			cout << dp[i][j];
		} // end rep
		cout << endl;
	} // end rep
}

int main()
{
//	cut here before submit 
//	freopen ("testcase.square_searching", "r", stdin );
	int n;
	while (scanf ("%d", &n ), n ){
		memset (grid, 0, sizeof (grid ) );
		memset (dp, 0, sizeof (dp ) );
		rep (i, n ){
			rep (j, n ){
				scanf (" %c", &grid[i][j] );
			} // end rep
		} // end rep

		dp[0][0] = (grid[0][0] == '.' ? 1 : 0 );
		for (int i = 1; i < n; i++ ){
			dp[i][0] = (grid[i][0] == '*' ? 0 : 1 );
		} // end for
		for (int j = 1; j < n; j++ ){
			dp[0][j] = (grid[0][j] == '*' ? 0 : 1 );
		} // end for
		for (int i = 1; i < n; i++ ){
			for (int j = 1; j < n; j++ ){
				dp[i][j] = (grid[i][j] == '*' ? 0 : min (dp[i-1][j-1], min (dp[i-1][j], dp[i][j-1] ) ) + 1 );
			} // end for
		} // end for
		
//		disp_grid (n );
//		disp_dp (n );
		int res = 0;
		for (int i = 1; i < n; i++ ){
			for (int j = 1; j < n; j++ ){
				res = max (res, dp[i][j] );
			} // end for
		} // end for
		printf ("%d\n", res );
	} // end loop

		
	return 0;
}