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

int main(){
	int n;
	while (cin >> n ) {
		if (n == 0) { break; }
		int dot[2][1001] = {}, max = 0, kake = 42, han;
		string inl;
		for (int i = 0; i < n; i++) {
			cin >> inl;
			for (int j = 1; j <= n; j++) {
				han = inl[j - 1];
				if (han == kake) {
					dot[1][j] = 0;
				}
				else {
					dot[1][j] = min({ dot[0][j],dot[1][j - 1],dot[0][j - 1] }) + 1;
				}
				if (max < dot[1][j]) {
					max = dot[1][j];
				}
			}
			for (int i = 1; i <= n; i++) {
				dot[0][i] = dot[1][i];
			}
		}
		cout << max << endl;
	}

	return 0;
}