#include <iostream>
#include <vector>

using namespace std;

void solve()
{
	int n;
	while(cin >> n, n)
	{
		vector< vector<char> > field(n + 1, vector<char>(n + 1));
		for(int i = 1; i <= n; ++i)
		{
			for(int j = 1; j <= n; ++j)
			{
				cin >> field[i][j];
			}
		}
		int max_val = 0;
		vector< vector<int> > dp(n + 1, vector<int>(n + 1));
		for(int i = 1; i <= n; ++i)
		{
			for(int j = 1; j <= n; ++j)
			{
				if(field[i][j] == '*')
				{
					dp[i][j] = 0;
				}
				else
				{
					dp[i][j] = min(dp[i - 1][j - 1], min(dp[i - 1][j], dp[i][j - 1])) + 1;
					if(max_val < dp[i][j])
					{
						max_val = dp[i][j];
					}
				}
			}
		}
		cout << max_val << endl;
	}
}

int main()
{
	solve();
	return(0);
}