#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <cstring>
using namespace std;

#define MAX_N 1000

char field[MAX_N][MAX_N];
int square[MAX_N][MAX_N];

int main() {
	int n;
	while (cin >> n, n) {
		getchar();
		memset(square, 0, sizeof(square));
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				field[i][j] = getchar();
				if (field[i][j] == '*') square[i][j] = 0;
				else square[i][j] = 1;
			}
			getchar(); // 改行をつぶす
		}

/*		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				putchar(field[i][j]);
			}
			putchar('\n');
		} */

		for (int i = 1; i < n; i++) {
			for (int j = 1; j < n; j++) {
				if (field[i][j] == '.') {
					square[i][j] = min(min(square[i-1][j], square[i][j-1]), square[i-1][j-1])+1;
				}
			}
		}

		int max_l = 0;
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				max_l = max(max_l, square[i][j]);
			}
		}
		
		cout << max_l << endl;
	}
	return 0;
}