//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;
bool mat[MAXN][MAXN];

int solve(void)
{
    //all filled
    bool empty;
    empty = false;
    REP(i,n) REP(j,n) empty = empty || mat[i][j]; 
    if(!empty) return 0;
    //check for all 
    int lmax = 0;
    REP(i,n){ REP(j,n){
        if(!mat[i][j]) continue;
        int l0 = min(n-i,n-j);
        int l1 = l0;
        REP(l,l0){ 
            REP(m,l+1){
                if((!mat[i+l][j+m])||(!mat[i+m][j+l])){ 
                    l1 = l;
                    goto outofloop;
                }
            }
        }
        outofloop:
        if(lmax<l1) lmax = l1;
    }}
    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;
}