#include <iostream>
#include <vector>

using namespace std;

int n;

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

    for (int i = 0; i < n; i++)
        cin >> map[i];

    for (int i = 0; i < n; i++)
        if (map[i][0] == '.')
            dp[i][0] = 1;
    for (int i = 0; i < n; i++)
        if (map[0][i] == '.')
            dp[0][i] = 1;

    for (int i = 1; i < n; i++)
        for (int j = 1; j < n; j++) {
            if (map[i][j] == '*')
                dp[i][j] = 0;
            else {
                dp[i][j] = min(min(dp[i - 1][j], dp[i][j - 1])
                               , dp[i - 1][j - 1]) + 1;
                ans = max(ans, dp[i][j]);
            }
        }
    cout << ans << endl;
}

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

    return 0;
}