#include <bits/stdc++.h>
using namespace std;

int main() {
	int n;
	while (cin >> n && n) {
		string s[n];
		for (auto &i : s) {
			cin >> i;
		}
		int dp[n][n]{};	//dp[i][j] := s[i][j]が右下になるような正方形の1辺の長さの最大値
		for (int i = 0; i < n; i++) {
			dp[0][i] = s[0][i] == '.';
			dp[i][0] = s[i][0] == '.';
		}
		for (int i = 1; i < n; i++) {
			for (int j = 1; j < n; j++) {
				if (s[i][j] == '*') {
					continue;
				}
				dp[i][j] = min({dp[i - 1][j], dp[i][j - 1], dp[i - 1][j - 1]}) + 1;
			}
		}
		int ans = 0;
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				ans = max(ans, dp[i][j]);
			}
		}
		cout << ans << endl;
	}
	return 0;
}
