#include <iostream>
#include <vector>
#include <string>
using namespace std;
int dp[1010][1010];
int main()
{
	int n;
	while (true) {
		cin >> n; 
		if (n == 0) break;
		vector<string> masu(n);
		for (int i = 0; i < n; ++i) cin >> masu[i];

		int res = 0;
		for (int i = 0; i < n; ++i) dp[i][0] = masu[i][0] == '.';
		for (int j = 0; j < n; ++j) dp[0][j] = masu[0][j] == '.';
		for (int i = 1; i < n; ++i) {
			for (int j = 1; j < n; ++j) {
				if (masu[i][j] == '.') {
					dp[i][j] = min(dp[i-1][j], min(dp[i-1][j-1], dp[i][j-1]))+1;
				}
				else {
					dp[i][j] = 0;
				}
				res = max(res, dp[i][j]);
			}
		}
		cout << res << endl;
	}
	return 0;
}