#include<iostream>
using namespace std;
int board[1001][1001];
int main(void) {
	int n;
	while (1) {
		char l;
		int max_count = 0;
		cin >> n;
		if (n == 0)break;
		for (int i = 1; i <= n; i++) {
			for (int j = 1; j <= n; j++) {
				cin >> l;
				if (l == '.')	board[i][j] = 1;
				else board[i][j] = 0;
				int  count = 1;
				while (count) {
					int judge = 1;
					if (board[i - 1][j - 1] >= count - 1 && board[i - 1][j] >= count - 1 && board[i][j - 1] >= count - 1 && board[i][j] != 0) {
						board[i][j] = count;
						judge = 0;
						if (count > max_count) max_count = count;
					}
					if (judge) break;
					count++;
				}
			}
		}
		cout << max_count << endl;
	}
}