#include <iostream>

using namespace std;

int n;
string s;
int dp[1000][1000];

int main() {

    while (cin >> n) {
        if (n == 0) break;

        for (int i = 0; i < n; i++) {
            cin >> s;
            for (int j = 0; j < n; j++) {
                dp[i][j] = s[j] == '.' ? 1 : 0;
            }
        }

        int ans = 0;

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

        cout << ans << endl;
    }
}
