#include <iostream>
#include<math.h>
#include<iomanip>
#include<vector>
#include<algorithm>
#include<functional>
#include<string>
using namespace std;
int aa[1000][1000]={};
int main()
{
    int  i=0,j=0,n=0,a1=0,a2=0,a3=0,mini=0,maxx=0;
    char s1;
    while(1){
    cin >> n;
    if(n==0)break;
    maxx=0;
    for(i=0;i<n;i++){
        for(j=0;j<n;j++){
            cin >> s1;
            if(s1=='.'){
                aa[i][j]=1;
            }
            if(s1=='*'){
                aa[i][j]=0;
            }
        }
    }
       /* for(i=0;i<n;i++){
            for(j=0;j<n;j++){
                cout << aa[i][j];
            }
            cout <<endl;
        }*/
        for(i=1;i<n;i++){
            for(j=1;j<n;j++){
                if(aa[i][j]==1){
                    a1=aa[i-1][j-1];
                    a2=aa[i-1][j];
                    mini = min(a1,a2);
                    a3=aa[i][j-1];
                    mini = min(mini,a3);

                    if(mini==0){
                        aa[i][j]=1;
                    }
                    else{
                        aa[i][j]=mini+1;
                        if(maxx<aa[i][j])maxx=aa[i][j];
                    }
                }
            }
        }
        cout << maxx << endl;

    }
}