#include<iostream>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

int min(int x,int y){
	if(x<y)return x;
	else return y;
}

int max(int x,int y){
	if(x>y)return x;
	else return y;
}

int main(){
	int n;
	while(cin>>n,n){
		char dt[n][n];
		int left[n][n],up[n][n];
		int square[n][n];
		rep(i,n){
			rep(j,n){
				cin>>dt[i][j];
				if(dt[i][j]=='.'){
					if(j!=0)left[i][j]=left[i][j-1]+1;
					else left[i][j]=1;
					if(i!=0)up[i][j]=up[i-1][j]+1;
					else up[i][j]=1;
					if(i==0 || j==0)square[i][j]=1; 
				}else{
					left[i][j]=up[i][j]=square[i][j]=0;
				}
			}
		}
		loop(i,1,n){
			loop(j,1,n){
				square[i][j]=min(min(left[i][j],up[i][j]),square[i-1][j-1]+1);
			}
		}
		int ans=0;
		rep(i,n)rep(j,n)ans=max(ans,square[i][j]);
		cout<<ans<<endl;
	}
	return 0;
}