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

char dt[1000][1000];
int dp[1000][1000];

int main(){
	int n;
	while(cin>>n,n){
		rep(i,n){
			rep(j,n){
				cin>>dt[i][j];
				if(dt[i][j]=='*')dp[i][j]=0;
				else if(i==0 || j==0)dp[i][j]=1;
				else dp[i][j]=INF;
			}
		}
		loop(i,1,n){
			loop(j,1,n){
				if(dp[i][j]==0)continue;
				dp[i][j]=min(min(dp[i][j-1],dp[i-1][j]),dp[i-1][j-1])+1;
			}
		}
		int ans=0;
		rep(i,n){
			rep(j,n){
				ans=max(ans,dp[i][j]);
			}
		}
		cout<<ans<<endl;
	}
	return 0;
}