#include <bits/stdc++.h>

using namespace std;

int main ()
{
	int N;
	while( cin >> N , N )
	{
		vector<vector<int>>data ( N + 1 , vector<int> ( N + 1 ) );
		for( size_t i = 1; i < N + 1; i++ )
		{
			for( size_t j = 1; j < N + 1; j++ )
			{
				char c;
				cin >> c;
				if( c == '.' )data[i][j] = 1;
			}
		}
		for( size_t i = 1; i < N + 1; i++ )
		{
			for( size_t j = 1; j < N + 1; j++ )
			{
				data[i][j] += data[i][j - 1];
			}
		}
		for( size_t i = 1; i < N + 1; i++ )
		{
			for( size_t j = 1; j < N + 1; j++ )
			{
				data[i][j] += data[i - 1][j];
			}
		}
		long long int ans = INT_MIN;
		for( size_t i = 0; i < N; i++ )
		{
			for( size_t j = 0; j < N; j++ )
			{
				for( size_t k = i + 1; k < N + 1; k++ )
				{
					for( size_t l = j + 1; l < N + 1; l++ )
					{
						long long int num = data[k][l] + data[i][j] - data[k][j] - data[i][l];
						if( ( k - i ) == ( l - j ) && ( k - i )*( l - j ) == num&& num > ans )
						{
							ans = num;
						}
					}
				}
			}
		}
		cout << sqrt ( ans ) << endl;
	}
}