#include <vector>
#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
	int H, max_;

	while (true)
	{
		max_ = 0;

		cin >> H;

		if (H == 0) { break; }

		vector<vector<char> > c(H, vector<char>(H));

		vector<vector<int> > dp(H, vector<int>(H, 0));

		for (int i = 0; i < H; i++)
		{
			dp[0][i] = 1; dp[i][0] = 1;
		}

		for (int i = 0; i < H; i++)
		{
			for (int j = 0; j < H; j++)
			{
				cin >> c[i][j];

				if (c[i][j] == '*')
				{
					dp[i][j] = 0;
				}
				else
				{
					max_ = 1;
				}
			}
		}

		for (int i = 1; i < H; i++)
		{
			for (int j = 1; j < H; j++)
			{
				if (c[i][j] == '.')
				{
					dp[i][j] = min({ dp[i - 1][j - 1], dp[i - 1][j], dp[i][j - 1] }) + 1;

					max_ = max(dp[i][j], max_);
				}
			}
		}

		cout << max_ << endl;
	}

	return 0;
}