#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;

const long double PI = acos(-1);
constexpr long double EPS = 1e-15;
constexpr int inf = 2e9;
constexpr ll INF = 2e18;
constexpr ll MOD = 1e9+7;
constexpr ll MOD1 = 998244353;
typedef pair<ll,ll> P;

//#define all(v) (v).begin(), (v).end()
#define rep(i,a,b) for (int i = (a); i < (b); i++)
#define REP(i,n) rep(i,0,n)
#define sz(s) (s).size()
#define pb push_back
#define fi first
#define se second
//#define mp make_pair

int dp[1010][1010];

int main(){
    int n;
    while (cin >> n, n) {
        int ans = 0;
        char maze[n][n];
        REP(i,n) {
            cin >> maze[i];
        }
        REP(i,1010) {
            memset(dp[i],0,sizeof(dp[i]));
        }
        REP(i,n) {
            REP(j,n) {
                if (maze[i][j] == '*') continue;
                dp[i+1][j+1] = min({dp[i][j],dp[i+1][j],dp[i][j+1]}) + 1;
                ans = max(ans, dp[i+1][j+1]);
            }
        }
        cout << ans << endl;
    }

}
