#include <iostream>
#include <algorithm>
using namespace std;

int mapInfo[1000][1000];

int main()
{
	int n;
	while(cin >> n, n)
	{
		for(int y = 0; y < n; y++)
		{
			for(int x = 0; x < n; x++)
			{
				char input;
				cin >> input;
				mapInfo[x][y] = input == '.' ? 1 : 0;
			}
		}
		
		for(int y = 1; y < n; y++)
		{
			for(int x = 1; x < n; x++)
			{
				if(mapInfo[x][y] == 0) continue;
				mapInfo[x][y] = min({mapInfo[x - 1][y - 1], mapInfo[x - 1][y], mapInfo[x][y - 1]}) + 1;
			}
		}
		
		int max_ = 0;
		for(int y = 0; y < n; y++)
		{
			for(int x = 0; x < n; x++)
			{
				max_ = max(max_, mapInfo[x][y]);
			}
		}
		
		cout << max_ << endl;
		
	}
	
	
	return 0;
}