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

int dp[1000][1000];
string k[1000];
int main(){
	int a;
	while (cin >> a, a) {
		for (int b = 0; b < a; b++) {
			cin >> k[b];
			for (int d = 0; d < a; d++) {
				if (k[b][d] == '.')dp[b][d] = 1;
				else dp[b][d] = 0;
			}
		}
		int MAX = 0;
		for (int b = 1; b < a; b++) {
			for (int c = 1; c < a; c++) {
				if (k[b][c] == '*') { dp[b][c] = 0; continue; }
				dp[b][c] = min({dp[b-1][c-1],dp[b][c-1],dp[b-1][c]})+1;
				MAX = max(MAX, dp[b][c]);
			}
		}
		cout << MAX << endl;
	}
}