//C++11

#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

#define REP(i,n) for(int i=0;i<(n);i++)

const int MAXN = 1000;
int n;
int  num[MAXN][MAXN];
bool mat[MAXN][MAXN];

int solve(void)
{   
    int lmax=0;
    REP(i,n){ REP(j,n){
        if(i==0||j==0) num[i][j]=(mat[i][j])?1:0;
        else num[i][j]=(mat[i][j])?min(num[i-1][j-1],min(num[i-1][j],num[i][j-1]))+1:0;
        if(num[i][j]>lmax) lmax=num[i][j];
    }}
    return lmax;
}

int main(void)
{
    while(true){
        //read
        cin >> n;
        if(!n) break;
        REP(j,n){ 
            string s;
            cin >> s;
            REP(i,n) mat[i][j] = (s[i]=='.') ? true : false;
        }
        //solve and print
        int res = solve();
        cout << res << endl;
    }
    return 0;
}