#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;

int n;
char table[1010][1010];
int co[1010][1010];

int main(){
	while (cin >> n&&n){
		REP(i, n) REP(j, n) cin >> table[i][j];
		REP(i, n){
			REP(j, n){
				if (table[i][j] == '*'){
					co[i][j] = 0;
				}
				else{
					if (j == 0)co[i][j] = 1;
					else co[i][j] = co[i][j - 1] + 1;
				}
			}
		}
		REP(i, n){
			if (i == 0)continue;
			REP(j, n){
				if (co[i][j] == 0)continue;
				co[i][j] += co[i - 1][j];
			}
		}

		//REP(i, n){
		//	REP(j, n){
		//		printf("%3d", co[i][j]);
		//	}
		//	cout << endl;
		//}
		int ans = 0;
		REP(i, n){
			REP(j, n){
				FOR(z, 1, n - max(i, j) + 1){
					bool f = 1;
					REP(k, z){
						REP(l, z){
							if (co[i + k][j + l] <= k*l)f = 0;
						}
					}
					if (f)ans = max(ans, (int)z);
				}
			}
		}
		cout << ans << endl;
	}
}