#include<iostream>
#include<vector>
#include<algorithm>
#include<utility>
#include<string>
#include<cmath>
#include<cstring>
#include<queue>
#include<map>
#include<climits>
#include<set>
#include<tuple>
#include<stack>


using namespace std;
typedef pair<int, int> pii;
typedef long long int ll;
typedef pair<ll, ll> pll;
typedef tuple<int, int, int> tpl;
int dx[4] = { 1,0,0,-1 };
int dy[4] = { 0,1,-1,0 };

#define ARRAY_MAX 300

const int INF = 1 << 30;
const int MOD = 1e9 + 7;

template<typename T>
T maxSquare(vector< vector<T> >& board) {
	T H = board.size(), W = board[0].size();
	vector< vector<T> > dp(H, vector<T>(W));

	T ret = 0;
	for (int i = 0; i < H; i++)
	{
		for (int j = 0; j < W; j++)
		{
			if (board[i][j] == 1) continue;
			if (i == 0 || j == 0) dp[i][j] = 1;
			else {
				dp[i][j] = min(dp[i - 1][j - 1], min(dp[i][j - 1], dp[i - 1][j])) + 1;
			}
			ret = max(ret, dp[i][j]);
		}

	}
	return ret;
}

int main() {

	int n;

	while (cin >> n,n)
	{
		vector < vector<int> > vec(n, vector<int>(n));
		for (int i = 0; i < n; i++)
		{
			for (int j = 0; j < n; j++)
			{
				char c;
				cin >> c;
				if (c == '*')
				{
					vec[i][j] = 1;
				}
				else
				{
					vec[i][j] = 0;
				}
			}
		}
		cout << maxSquare(vec) << endl;
		vec.shrink_to_fit();
	}

	

	return 0;
}
