#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int sq[1000][1000];
char b[1000][1000];

int main() {
	int n;
	while (cin >> n , n) {
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				cin >> b[i][j];
			}
		}

		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				sq[i][j] = (b[i][j] == '.') ? 1 : 0;
			}
		}

		int ans = 0;
		for (int i = 1; i < n; i++) {
			for (int j = 1; j < n; j++) {
				if (b[i][j] == '*') continue;
				int len = min({sq[i - 1][j - 1], sq[i - 1][j], sq[i][j - 1]});
				sq[i][j] = len + 1;
				ans = max(ans, sq[i][j]);
			}
		}

		cout << ans << endl;
	}
}