#include<iostream>
#include<cstdio>
#include<algorithm>
#include<climits>
using namespace std;

char fld[1001][1001];
int dp[1001][1001];

int main(){
	int N;
	while(cin>>N,N){
		int ans=0;
		for(int i=0;i<=N;i++){
			for(int j=0;j<=N;j++){
				if(i==0 || j==0){
					dp[i][j] = 0; continue;
				}
				cin>>fld[i][j];
				if(fld[i][j]!='.'){
					dp[i][j] = 0; continue;
				}
				dp[i][j] = min(dp[i-1][j],dp[i][j-1]);
				if(fld[i-dp[i][j]][j-dp[i][j]]=='.') ans = max(ans,++dp[i][j]);
				else dp[i][j] = max(dp[i][j],1);
			}
		}
		printf("%d\n",ans);
	}
	return 0;
}