#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <numeric>

#define REP(i, a, b) for (int i = int(a); i < int(b); i++)
#ifdef _DEBUG_
#define dump(val) cerr << __LINE__ << ":\t" << #val << " = " << (val) << endl
#else
#define dump(val)
#endif

using namespace std;

typedef long long int ll;

template<typename T>
vector<T> make_v(size_t a, T b) {
    return vector<T>(a, b);
}
template<typename... Ts>
auto make_v(size_t a, Ts... ts) {
    return vector<decltype(make_v(ts...))>(a, make_v(ts...));
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n;
    while (cin >> n, n) {
        auto mp = make_v(n + 1, n + 1, '*');
        REP(i, 0, n) {
            REP(j, 0, n) {
                cin >> mp[i + 1][j + 1];
            }
        }
        auto dp = make_v(n + 1, n + 1, 0);
        REP(i, 1, n + 1) {
            REP(j, 1, n + 1) {
                if (mp[i][j] == '.') {
                    dp[i][j] = min({dp[i - 1][j - 1], dp[i][j - 1], dp[i - 1][j]}) + 1;
                }
            }
        }
        int ans = 0;
        REP(i, 1, n + 1) {
            REP(j, 1, n + 1) {
                ans = max(ans, dp[i][j]);
            }
        }
        cout << ans << endl;
    }
    return 0;
}

