#include <iostream>
#include <algorithm>
using namespace std;
char field[1001][1001];
int dp[1001][1001] = { 0 };

int main() {
	int n;

	while (cin >> n, n) {
		for (int i = 0; i < n; ++i) {
			for (int j = 0; j < n; ++j) {
				cin >> field[i][j];
				if (field[i][j] == '*') dp[i][j] = 0;
			}
		}

		for (int i = 0; i < n; ++i) {
			if (field[0][i] == '.') dp[0][i] = 1;
		}

		for (int i = 0; i < n; ++i) {
			if (field[i][0] == '.') dp[i][0] = 1;
		}

		int min, msquare = 0;
		for (int i = 1; i < n; ++i) {
			for (int j = 1; j < n; ++j) {
				if (field[i][j] == '*') continue;
				min = dp[i - 1][j - 1];
				if (dp[i][j - 1] < min) min = dp[i][j - 1];
				if (dp[i - 1][j] < min) min = dp[i - 1][j];
				dp[i][j] = min + 1;
				if (dp[i][j] > msquare) msquare = dp[i][j];
			}
		}
		cout << msquare << endl;
		
	}

	return 0;
}