#include<iostream>
#include<string>

using namespace std;

#define NMAX 1010

int main(){

    int n;
    string sqs[NMAX+1];
    int sqi[NMAX+1][NMAX+1];
    int sqw[NMAX+1][NMAX+1];
    int max;
    int mx,mn;

    while(1){

        cin>>n;
        if(n==0) break;

        for(int i=0;i<=n;i++){
            for(int j=0;j<=n;j++){
                sqi[i][j]=0;
                sqw[i][j]=0;
            }
        }

        for(int i=0;i<n;i++){
            cin>>sqs[i];
        }

        for(int i=1;i<=n;i++){
            for(int j=1;j<=n;j++){
                if(sqs[i-1][j-1]=='.') sqi[i][j]=1;
                else sqi[i][j]=0;
            }
        }

        for(int i=1;i<=n;i++){
            for(int j=1;j<=n;j++){
                sqw[i][j]=sqi[j][i]+sqw[i-1][j]+sqw[i][j-1]-sqw[i-1][j-1];
            }
        }

        max=0;

        for(int i=1;i<=n;i++){
            for(int j=1;j<=n;j++){
	        if(sqi[i][j]==0) continue;
                if(i>j) mx=10-i;
                else mx=10-j;
                mn=0;
	    
	        while(mn<=mx){
                    int k=(mx+mn)/2;
                    if((k+1)*(k+1)==sqw[i+k][j+k]-sqw[i+k][j-1]-sqw[i-1][j+k]+sqw[i-1][j-1]){
                        mn=k+1;
                    }
                    else mx=k-1;
		}
                if(mn>max) max=mn;
            }
        }
        cout<<max<<endl;
    }

}