#include<iostream>
using namespace std;

#define N 1000

#define max((a),(b)) ((a)>(b)?(a):(b))
#define min((a),(b)) ((a)>(b)?(b):(a))

int main() {
	char map[N][N]; int l[N][N], ans, n, dp[N][N], c;
	while(1) {
		cin >> n;
		if(!n) break;
		c = 0;
		for(int i=0; i<n; ++i) {
			for(int j=0; j<n; ++j) {
				cin >> map[i][j]; l[i][j] = 0;
				if(map[i][j]=='*') {
					c++;
					if(i) {
						int k = 1;
						while(map[i-k][j]!='*') {
							l[i-k][j] = k;
							if(i<(++k)) break;
						}
					}
				}
			}
		}
		for(int j=0; j<n; ++j) {
			int k = 1;
			while(map[n-k][j]!='*') {
				l[n-k][j] = k;
				if(n<(++k)) break;
			}
		}
		if(c==n*n) {
			cout << "0" << endl;
			continue;
		}
		ans = 1;
		for(int i=0; i<n; ++i) {
			for(int j=0; j<n; ++j) dp[j][j] = l[i][j];
			int r = 0;
			for(int l=0; l<n; ++l) {
				if(r<l) r = l;
				while(dp[l][r]>(r-l+1)&&r<n-1) {
					r++;
					for(int m=l; m<r; ++m) {
						dp[m][r] = min(dp[m][r-1], dp[r][r]);
					}
				}
				ans = max(ans, min(dp[l][r], r-l+1));
			}
		}
		cout << ans << endl;
	}
	return 0;
}