#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < n; i++)

int main() {
    int n, dp[1005][1005], ans = 0;
    string s[1005];
    while(cin >> n, n){
        REP(i,n){
            cin >> s[i];
        }
        REP(i,n+1) fill(dp[i], dp[i]+n+1, 0);
        ans = 0;
        REP(i,n){
            REP(j,n){
                if(s[i][j] == '*') continue;
                dp[i+1][j+1] = min({dp[i][j] ,dp[i][j+1], dp[i+1][j]}) + 1;
                ans = max(ans, dp[i+1][j+1]);
            }
        }
        cout << ans << endl;
    }
    return 0;
}
