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

using namespace std;

int main(void) {
	int n, i, j, maxValue;
	int arr[1001][1001],dp[1001][1001];
	char c;

	while (cin >> n,n){
        memset(arr, 0, sizeof(arr));
		memset(dp, 0, sizeof(dp));

		for (i = 0; i < n; i++) {
			for (j = 0; j < n; j++) {
				cin >> c;
				if (c == '.') {
					arr[i][j] = 1;
				}
				else {
					arr[i][j] = 0;
				}
			}
		}

		maxValue = 0;
		for (i = 0; i < n; i++) {
			for (j = 0; j < n; j++) {
				if (i == 0 || j == 0) {
					dp[i][j] = arr[i][j];
				}
				else if(arr[i][j] == 1)
				{
					dp[i][j] = min(min(dp[i-1][j], dp[i][j-1]), dp[i-1][j-1]) + 1;
				}
				maxValue = max(maxValue, dp[i][j]);
			}
		}

		cout << maxValue << endl;
	}

	return 0;
}


