#include<iostream>
#include<string>

using namespace std;

#define NMAX 1000

int main(){

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

    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++){
                for(int k=0;i+k<=n&&j+k<=n;k++){
                    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]){
                        if(max<k+1) max=k+1;
                    }
                }
            }
        }
        cout<<max<<endl;
    }

}