#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>
#include <climits>
using namespace std;
static const double EPS = 1e-5;
typedef long long ll;

int dp[1000][1000];
char d[1000][1000];

main(){
	int n;
	while(cin>>n){
		if(n==0)break;
		for(int i=0;i<n;i++)
			for(int j=0;j<n;j++)cin>>d[i][j];

		int smax=0;
		for(int i=0;i<n;i++){
			if(d[i][0]=='*')dp[i][0]=0;
			else smax=dp[i][0]=1;
			
			if(d[0][i]=='*')dp[0][i]=0;
			else smax=dp[0][i]=1;
		}

		for(int i=1;i<n;i++){
			for(int j=1;j<n;j++){
				if(d[i][j]=='*')dp[i][j]=0;
				else dp[i][j]=min(dp[i-1][j-1],min(dp[i-1][j],dp[i][j-1]))+1;
				
				smax=max(smax,dp[i][j]);
			}
		}
		cout<<smax<<endl;
	}
}