#include <iostream>
#include <vector>

using namespace std;

int n;

void solve()
{
    vector<string> map(n);
    vector<vector<int> > sum(n, vector<int>(n + 1, 0));
    int ans = 1;

    for (int i = 0; i < n; i++)
        cin >> map[i];
    for (int i = 0; i < n; i++)
        for (int j = n - 1; j >= 0; j--)
            if (map[i][j] == '.')
                sum[i][j] = sum[i][j + 1] + 1;

    for (int i = 0; i < n; i++)
        for (int j = 0; j < n; j++)
            if (map[i][j] == '.') {
                int h = 1, w = sum[i][j];

                while (i + h < n) {
                    w = min(w, sum[i + h][j]);
                    h++;

                    if (w < h)
                        break;
                    if (h > ans)
                        ans = h;
                }
            }
    cout << ans << endl;
}

int main()
{
    while (cin >> n, n) {
        solve();
    }

    return 0;
}