#include<iostream>
#include<iomanip>
#define MAX 1000
#define Rep(i,m,n) for(i=m;i<n;i++)
#define rep(i,n) Rep(i,0,n)
using namespace std;
	int main(){
		short n,i,j,s[MAX][MAX],min,max;
		char u[MAX][MAX];
		while(cin>>n,n){
			max=0;
			rep(i,n)
				cin>>u[i];
			rep(i,n)
			rep(j,n)
			{
				if(u[i][j]=='.')
					s[i][j]=1;
				else s[i][j]=0;
			}
			Rep(i,1,n)
				Rep(j,1,n){
					if(s[i][j]==1){
						min=n;
						if(min>s[i][j-1])
							min=s[i][j-1];
						if(min>s[i-1][j])
							min=s[i-1][j];
						if(min>s[i-1][j-1])
							min=s[i-1][j-1];
						s[i][j]=min+1;
					}
					if(s[i][j]>max)
					max=s[i][j];
				}
			cout<<max<<endl;
		}
		return 0;
	}