#include <iostream>
#include <string>

using namespace std;

int n;
char field[1000][1000];

int dp[1000][1000];

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

	int max = 0;
	for(int y = 1; y < n; y++)
		for (int x = 1; x < n; x++) {
			int min = dp[y - 1][x - 1];
			if (min > dp[y][x - 1]) min = dp[y][x - 1];
			if (min > dp[y-1][x]) min = dp[y-1][x];
			dp[y][x] = min;
			if (min > max) max = min;
		}

	cout << max << endl;
}



int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	while (cin >> n, n) {
		for (int y = 0; y < n; y++)
			for (int x = 0; x < n; x++)
				cin >> field[y][x];
		solve();
	}

}