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

int main() {
	for(int N; cin >> N, N; ) {
		static bool field[1000][1000];
		for(int i = 0; i < N; ++i) {
			string s;
			cin >> s;
			for(int j = 0; j < (int)s.length(); ++j)
				field[i][j] = (s[j] == '.');
		}

		static int dp[1000 + 1][1000 + 1];
		for(int i = 0; i <= N; i++)
			dp[i][0] = 0, dp[0][i] = 0;

		int maxv = -1;
		for(int i = 1; i <= N; i++) {
			for(int j = 1; j <= N; j++) {
				bool b = field[i - 1][j - 1];
				dp[i][j] = dp[i - 1][j] + dp[i][j - 1] - dp[i - 1][j - 1] + (b ? 1 : 0);

				for(int k = 1; min(i - k, j - k) >= 0; k++) {
					if(dp[i][j] == dp[i - k][j] + dp[i][j - k] - dp[i - k][j - k] + k * k) {
						maxv = max(maxv, k);
					}
				}
			}
		}
		cout << maxv << endl;
	}
}