#include <iostream>
#include <cstring>
using namespace std;
int main () {
	int n;
	while (cin >> n, n) {
		char field[n + 1][n + 1];
		int dp[n + 1][n + 1];
		memset(dp, 0, sizeof(dp));
		for (int i = 1; i <= n; i++) {
			for (int j = 1; j <= n; j++) {
				cin >> field[i][j];
			}
		}
		for (int i = 0; i <= n; i++) {
			dp[i][0] = dp[0][i] = 0;
		}
		int result = 0;
		for (int i = 1; i <= n; i++) {
			for (int j = 1; j <= n; j++) {
				if (field[i][j] == '.') {
					dp[i][j] = min(dp[i - 1][j - 1], min(dp[i - 1][j], dp[i][j - 1])) + 1;
					result = max(dp[i][j], result);
				}
//				cout << '\t' << dp[i][j];
			}
//			cout << endl;
		}
		cout << result << endl;
	}
	return 0;
}