#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <map>
#include <algorithm>
#include <iomanip>
#include <cmath>
using namespace std;

#define MAXV 1000000000
#define MOD 1000000007
using ll = long long;

bool operator<(const pair<int, int>& a, const pair<int, int>& b) {
	if (a.first == b.first) {
		return a.second < b.second;
	}
	return a.first < b.first;
}
int N; 


int main() {

	while (cin >> N) {
		if (N == 0) break;
		cin.ignore();
		vector<string> v;
		for (int i = 0; i < N; ++i) {
			string s; 
			getline(cin, s);
			v.push_back(s);
		}
		int dp[1010][1010] = { 0 };


		for (int i = 0; i < N; ++i) {
			if(v[i][0]=='.') dp[i][0]=1;
            if(v[0][i]=='.') dp[0][i]=1;
		}
		int ans = 0;
		for (int i = 1; i < N; ++i) {
			for (int j = 1; j < N; ++j) {
				if (v[i][j] != '.') {
					dp[i][j] = 0;
				}
				else {
					dp[i][j] = min({ dp[i - 1][j], dp[i][j - 1], dp[i - 1][j - 1] }) + 1;
		
					ans = max(ans, dp[i][j]);
				}
			}
		}
		cout << ans << endl;
	}

}
