#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;

#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for (int i = x; i < n; i++)
#define OP(m) cout << m << endl
typedef long long ll;
typedef unsigned long long ull;

int dp[1001][1001];

int main()
{
    int n;
    char c;
    while (cin >> n, n)
    {
        rep(i, n)
        {
            rep(j, n)
            {
                cin >> c;
                dp[i][j] = (c == '*' ? 0 : 1);
            }
        }

        int maxv = 0;
        for (int i = 1; i < n; i++)
        {
            for (int j = 1; j < n; j++)
            {
                if (dp[i][j] == 0)
                    continue;
                dp[i][j] = min({dp[i][j - 1], dp[i - 1][j - 1], dp[i - 1][j]}) + 1;
                maxv = max(maxv, dp[i][j]);
            }
        }
        OP(maxv);
    }

    return 0;
}
