#include<stdio.h>
#include<string>
#include<stdlib.h>
#include<math.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<numeric>
#include<string.h>
#include<map>
#include<queue>

using namespace std;

typedef pair<int,int> pii;

#define rep(i,j) for(int i=0;i<(j);i++)
#define reps(i,j,k) for(int i=j;i<=k;i++)
#define in(i,j,k) ((i)>=(j)&&(i)<=(k))

int main(){
	char s[1001];
	int n,r,m;
	int w[1000],h[1000],a[2][1000];
	for(;;){
		scanf("%d",&n);
		if(!n)break;
		rep(i,1000){
			rep(j,2)a[j][i]=0;
			w[i]=h[i]=0;
		}
		r=0;
		rep(i,n){
			scanf("%s",s);
			rep(j,n){
				if(s[j]=='.'){
					a[i%2][j]=1;
					if(j>0){
						w[j]=w[j-1]+1;
						a[i%2][j]+=min(a[(1+i)%2][j-1],min(w[j-1],h[j]));
					}else w[j]++;
					h[j]++;
					r=max(r,a[i%2][j]);
				}else a[i%2][j]=h[j]=w[j]=0;
			}
		}
		printf("%d\n",r);
	}
	return 0;
}