#include <bits/stdc++.h>

using namespace std;

int dp[1010][1010];
char field[1010][1010];

int main(void) {
    int n;
    while (cin >> n, n) {
        memset(dp, 0, sizeof(dp));
        memset(field, '*', sizeof(field));

        for (int i = 0; i < n; i++)
            for (int j = 0; j < n; j++) {
                cin >> field[i][j];
                if (field[i][j] != '*') dp[i][j] = 1;
            }

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

    return 0;
}
