#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 = 0;
		for( size_t i = 0; i < N; i++ )
		{
			for( size_t j = 0; j < N; j++ )
			{
				for( size_t k = ans; i + k < N + 1 && j + k < N + 1; k++ )
				{
					long long int num = data[i + k][j + k] + data[i][j] - data[i + k][j] - data[i][j + k];
					if( k*k == num&& k > ans )
					{
						ans = k;
					}
				}
			}
		}
		cout << ans << endl;
	}
}