#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <cmath>

using namespace std;

#define pb push_back
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,j,k) for(int i=j;i<(k);i++)
#define foreach(T,c,i) for(T::iterator i=c.begin();i!=c.end();i++)
typedef vector<int> Array;
typedef vector<Array> Mat;
const int INF = 99999999;
int N;
string str;
int dx[] = {1,0,1};
int dy[] = {0,1,1};
int solve(Mat &dp)
{
	int ans = 0;
	rep(i,N){
		rep(j,N){
			if(dp[i+1][j+1]==INF){
				dp[i+1][j+1] = min(dp[i][j],min(dp[i][j+1],dp[i+1][j]))+1;
				ans = max(dp[i+1][j+1],ans);
			}
		}
	}
	return ans;
}


int main(){
	while(1){
		cin >> N;
		if(N==0) return 0;
		vector<string> map;
		rep(i,N){
			cin >> str;
			map.pb(str);
		}
		Mat dp(N+1,vector<int>(N+1,INF));
		rep(i,N+1) dp[0][i] = 0;
		rep(i,N){
			dp[i+1][0] = 0;
			rep(j,N){
				if(map[i][j]=='*') dp[i+1][j+1] = 0;
			}
		}
		cout << solve(dp) << endl;
	}
	
	return 0;	
}