#include <bits/stdc++.h>
using namespace std;
#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) begin(a),end(a)
#define MS(m,v) memset(m,v,sizeof(m))
#define D10  fixed<<setprecision(5)
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<short, short> P;
typedef complex<double> Point;
typedef long long ll;
const int INF = 114514810;
const int MOD = 100000007;
const double EPS = 1e-10;
const double PI = acos(-1.0);
struct edge
{
	int from, to, cost;
	bool operator < (const edge& e) const { return cost < e.cost; }
	bool operator >(const edge& e) const { return cost > e.cost; }
};
///*************************************************************************************///
///*************************************************************************************///
///*************************************************************************************///

int n;
vector<string> fld;

bool search(int m)
{
	REP(i, n - m + 1)REP(j, n - m + 1)
	{
		REP(k, m)REP(l, m)
		{
			if (fld[i + k][j + l] == '*') goto next;
		}

		return true;
	next:;
	}
	return false;
}

int main()
{
	while (cin >> n, n)
	{
		fld.resize(n);
		REP(i, n) cin >> fld[i];
		int lb = 0, ub = n;
		while (ub - lb > 1)
		{
			int mid = (ub + lb) / 2;
			if (search(mid)) lb = mid;
			else ub = mid;

		}
		cout << lb << endl;
	}
	return 0;
}