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

using namespace std;

int main(){
	int n;
	while(scanf("%d",&n)){
		if(n==0) break;
		int dp[1401][1401]={};
		int max_a=0;
		for(int i=1;i<=n;i++){
			char tp[1001];
			scanf("%s",tp);
			for(int j=1;j<=n;j++){
				if(tp[j-1]=='*')
				dp[i][j]=0;
				else
				dp[i][j]=min(dp[i-1][j],min(dp[i][j-1],dp[i-1][j-1]))+1;
				max_a=max(max_a,dp[i][j]);
			}
		}
		printf("%d\n",max_a);
	}
}
