#include<algorithm>
#include<iostream>
#include<cstring>

int n;
char field[1000][1000];
int dp[1000][1000];

int main()
{
	while( std::cin >> n, n )
	{
		for( int i = 0; i != n; ++i )
			for( int j = 0; j != n; ++j )
				std::cin >> field[i][j];
	
		int ans = 0;
		memset( dp, 0, sizeof( dp ) );
		for( int i = 0; i != n; ++i )
		{
			for( int j = 0; j != n; ++j )
			{
				if( i && j && field[i][j] == '.' )
				{
					dp[i][j] = std::min( dp[i-1][j-1], std::min( dp[i][j-1], dp[i-1][j] ) ) + 1;
					ans = std::max( ans, dp[i][j] );
				}
				else
					dp[i][j] = field[i][j] == '.';
			}
		}

		std::cout << ans << std::endl;
	}

	return 0;
}