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

int main() {
	for(int N; cin >> N, N; ) {
		static int field[1000][1000];
		memset(field, 0, sizeof field);

		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] == '.' ? 1 : 0);
		}

		static int dp[1000 + 1][1000 + 1];
		memset(dp, 0, sizeof dp);

		dp[1][1] = field[0][0];
		for(int i = 2; i <= N; i++) {
			dp[1][i] = field[0][i - 1] + dp[1][i - 1];
			dp[i][1] = field[i - 1][0] + dp[i - 1][1];
		}

		for(int i = 2; i <= N; i++)
			for(int j = 2; j <= N; j++)
				dp[i][j] = field[i - 1][j - 1] + dp[i - 1][j] + dp[i][j - 1] - dp[i - 1][j - 1];

		int maxv = 0;
		for(int i = 1; i <= N; i++) {
			for(int j = 1; j <= N; j++) {
				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;
	}
}