#include<iostream>
#include<vector>
using namespace std;
int main(){
    for(;;){
        int n;
        cin>>n;
        if(n==0)break;
        vector<string> ms(n);
        string ins;
        for(int i=0;i<n;i++){
            cin>>ins;
            ms[i]=ins;
        }
        vector<vector<int> > sq(n,vector<int>(n,0));
        for(int i=0;i<n;i++){
            if(ms[0][i]=='.')sq[0][i]=1;
            if(ms[i][0]=='.')sq[i][0]=1;
        }
        int ma=0;
        for(int i=1;i<n;i++){
            for(int j=1;j<n;j++){
                if(ms[i][j]=='.'){
                    sq[i][j]=min(min(sq[i-1][j],sq[i][j-1]),sq[i-1][j-1])+1;
                    ma=max(ma,sq[i][j]);
                }
            }
        }
        cout<<ma<<endl;
    }
}