#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

int main() {
	int n;

	while (cin >> n) {
		if (n == 0) {
			break;
		}
		vector< vector<char> > d(n, vector<char>(n));
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				cin >> d[i][j];
			}
		}
		vector< vector<int> > dd(n, vector<int>(n));
		int c = 0;
		for (int i = 0; i < n; i++) {
			int cc = 0;
			for (int j = n-1; j >= 0; j--) {
				if (d[i][j] == '.') {
					cc++;
				} else {
					cc = 0;
				}
				dd[i][j] = cc;
			}
		}
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				if (dd[i][j] > c) {
					int ccc = dd[i][j];
					for (int k = 0; i+k < n; k++) {
						if (dd[i+k][j] <= c) {
							break;
						}
						ccc = min(ccc, dd[i+k][j]);
						if (ccc <= k+1) {
							c = max(c, ccc);
						}
					}
				}
			}
		}
		cout << c << endl;
	}

	return 0;
}