#include <iostream>
#include <algorithm>
#include <string>
#include <cstring>

using namespace std;

bool field[1000][1000];

int dp[1000][1000];

int main() {
	for(int N; cin >> N, N;) {
		memset(field, 0, sizeof field);
		for(int i = 0; i < N; i++) {
			string line;
			cin >> line;
			for(int j = 0; j < N; j++)
				field[i][j] = (line[j] == '.');
		}

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

		int ans = 0;
		for(int i = 0; i < N; i++) {
			for(int j = 0; j < N; j++) {
				for(int k = ans; k < N; k++) {
					if(i - k < 0 || j - k < 0) break;
					int ni = i - k;
					int nj = j - k;
					if(dp[i][j] - dp[ni][j] - dp[i][nj] + dp[ni][nj] == k * k)
						ans = k;
				}
			}
		}

		cout << ans << endl;
	}
}