#include <bits/stdc++.h>

using namespace std;

#define rep(i, n) for(int i = 0; i < (int)n; ++i)
#define repf(i, f, l) for(int i = f; i < (int)l; ++i)
#define repit(it, t) for(__typeof((t).begin()) it = (t).begin(); it != (t).end(); it++)

#define endl "\n"

#ifdef ONLINE_JUDGE
#define DEBUG false
#else
#define DEBUG true
#endif

#define pb emplace_back
#define lb lower_bound
#define ul unsigned long
#define ull unsigned long long
#define ll long long
#define INF 1000000007
#define MOD 1000000007
#define fs first
#define sd second

#define ALL(c) (c).begin(),(c).end()

#define DBG0(x){if(DEBUG){ cout << #x << ": " << x << "\t"; }}
#define DBG(x) {if(DEBUG){DBG0(x); cout << endl;}}
#define DBG2(x, y) {if(DEBUG){DBG0(x); DBG(y);}}
#define DBG3(x, y, z) {if(DEBUG){DBG0(x); DBG2(y, z);}}
#define DBG4(w, x, y, z) {if(DEBUG){DBG0(w); DBG3(x, y, z);}}

template <class T>
ostream& operator<<(ostream& os, vector<T> xs){ for(T x: xs) os << x << ' '; return os; }
template <class S, class T>
ostream& operator<<(ostream& os, pair<S,T> st){ os << "(" << st.first << "," << st.second <<")"; return os; }

typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<ul> vul;
typedef vector<ull> vull;
typedef vector<bool> vbl;
typedef pair<int, int> pii;

int main(void){
    ios::sync_with_stdio(false);
    int n;
    while(cin >> n){
        if(n == 0) break;
        vector<string> vs(n);
        rep(i, n) cin >> vs[i];
        vector<vint> fld(n, vint(n, 0));

        rep(i, n){
            for(int j = n; 0 <= --j; ){
                if(j == n - 1){
                    if(vs[i][j] == '.') fld[i][j] = 1;
                    else fld[i][j] = 0;
                    continue;
                }
                if(vs[i][j] == '*') fld[i][j] = 0;
                else fld[i][j] = fld[i][j + 1] + 1;
            }
        }
        int mx = 0;

//      rep(i, n) DBG(fld[i]);
        rep(i, n) rep(j, n){
            if(fld[i][j] <= mx) continue;
            int m = fld[i][j];
            bool flg = true;
            rep(k, m){
                m = min(m, fld[i+k][j]);
                if(k + i == n - 1) break;
            }
            flg &= (n - i >= m);
            if(flg){
//              DBG4(i,j,m, mx);
                mx = max(m, mx);
            }
        }
        cout << mx << endl;
    }
    return 0;
}