#include <iostream>
#include <string>

using namespace std;

int n;
char field[1000][1000];

/*inline bool checksub(int x, int y, int m) {
	for (int ty = y; ty < y + m; ty++)
		for (int tx = x; tx < x + m; tx++)
			if (field[ty][tx] == '*') return false;
	return true;
}

inline bool check(int m) {
	for (int y = 0; y < n - m + 1; y++)
		for (int x = 0; x < n - m + 1; x++)
			if (checksub(x, y, m)) return true;
	return false;
}*/

/*void solve() {
	int left, right;
	left = 0;
	right = n+1;
	while (right - left > 1) {
		int mid = (left + right) / 2;
		if (check(mid))
			left = mid;
		else
			right = mid;
	}
	cout << left << endl;
}*/

void solve() {
	int newfield[1000][1000];

	for(int y = 0; y < n; y++)
		for(int x = 0; x < n; x++)
			if (field[y][x] == '*')
				for (int i = 0; i < n; i++)
					newfield[y][i] = newfield[i][x] = 1;

	int max = 0;
	for(int y = 0; y < n; y++)
		for (int x = 0; x < n; x++) {
			if (newfield[y][x]) continue;
			int i;
			for (i = 1; x+i < n && y+i < n; i++)
				if (newfield[y + i][x] || newfield[y][x + i]) break;
			if (i > max) max = i;
		}
	cout << max + 1 << endl;
}


int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	while (cin >> n, n) {
		for (int y = 0; y < n; y++)
			for (int x = 0; x < n; x++)
				cin >> field[y][x];
		solve();
	}

}