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

static const int MARGIN = 1;

int main() {
	int n;
	int table[1024][1024];
	vector<string> map;

	while(cin >> n, n) {
		int ans = 0;
		// init;
		for(int i = 0; i < 1024; i++)
			for(int j = 0; j < 1024; j++)
				table[i][j] = 0;
		map.clear();

		// input;
		for(int i = 0; i < n; i++) {
			string tmp;
			cin >> tmp;
			map.push_back(tmp);
		}

		for(int i = 0; i < n; i++) {
			for(int j = 0; j < n; j++) {
				if(map[i][j] == '.') {
					int tmp;
					tmp = min(table[i - 1 + MARGIN][j + MARGIN], table[i + MARGIN][j - 1 + MARGIN]);
					if(map[i - tmp][j - tmp] == '.') 
						table[i + MARGIN][j + MARGIN] = tmp + 1;
					if(table[i + MARGIN][j + MARGIN] > ans)
						ans = table[i + MARGIN][j + MARGIN];
				}
			}
		}

		cout << ans << endl;
	}

	return 0;
}