#include <iostream>
#include <cstdio>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <math.h>
#include <map>
#include <functional>
#include <iomanip>
#include <vector>
#include <queue>
#include <set>
#include <typeinfo>
#define PI 3.14159265359
#define INF 99999999;
#define rep(i, n) for(int i=0; i<n; i++)
#define REP(n) rep(i, n)
#define EPS 1e-10
typedef long long ll;
using namespace std;
typedef pair<int, int> P;



/*
class Target
{
public:
	vector <string> draw(int n)
	{

	}
};
*/



int main()
{
	int n;
	
	while (cin >> n, n)
	{
		char grid[n][n];
		int W[n][n];
		int maxWidth = 0;
		
		REP(n) cin >> grid[i];
		REP(n)
		{
			W[0][i] = (grid[0][i] == '*' ? 0 : 1);
			W[i][0] = (grid[i][0] == '*' ? 0 : 1);
		}
		for (int i=1; i<n; i++)
		{
			for (int j=1; j<n; j++)
			{
				if (grid[i][j] == '*')
				{
					W[i][j] = 0;
				} else {
					W[i][j] = min(W[i-1][j-1], min(W[i-1][j], W[i][j-1])) + 1;
					maxWidth = max(maxWidth, W[i][j]);
				}
			}
		}
		
		cout << maxWidth << endl;
	}
	
	return 0;
}