#include <iostream>

using namespace std;

int m[1001][1001] = {0};
bool in[1000][1000];

int GetVal(int x, int y) {
	if (x < 0 || y < 0) return 0;
	return m[y][x];
}

int main() {
	int n;
	while ( cin >> n, n ) {
		for (int y = 0; y < n; ++y) {
			string str; cin >> str;
			for (int x = 0; x < n; ++x) {
				m[y][x] = in[y][x] = str[x] == '*';
			}
		}
		for (int y = 0; y < n; ++y) {
			for (int x = 0; x < n; ++x) {
				m[y][x+1] += m[y][x];
			}
		}
		for (int y = 0; y < n; ++y) {
			for (int x = 0; x < n; ++x) {
				m[y+1][x] += m[y][x];
			}
		}
//		for (int y = 0; y < n; ++y) {
//			for (int x = 0; x < n; ++x) {
//				cout << m[y][x] << " ";
//			}
//			cout << endl;
//		}
		int l = 0, r = n+1;
		while ( r - l > 1 ) {
			int M = (l + r) / 2;
			bool f = false;
			for (int y = 0; y < n-M+1; ++y) {
				for (int x = 0; x < n-M+1; ++x) {
					int v = x == 0 || y == 0 ? 0 : m[y-1][x-1];
					if ( !in[y][x] && !in[y+M-1][x+M-1]
						&& GetVal(x+M-1, y+M-1) == GetVal(x-1, y+M-1) + GetVal(x+M-1, y-1) - GetVal(x-1, y-1) ) {
						f = true;
						break;
					}
				}
				if (f) break;
			}
			if (f) {
				l = M;
			}
			else {
				r = M;
			}
		}
		cout << l << endl;
	}
}