#include <iostream>
#include <cstdio>
#include <string>
using namespace std;

int dp[1002][1002];

int main() {
    int n;
    while (scanf("%d", &n), n) {
        int ret = 0;
        char line[1001];
        for (int i=1; i<=n; ++i) {
            scanf("%s", line);
            for (int j=0; j<n; ++j) {
                if (line[j] == '.') {
                    dp[i][j] = min(dp[i-1][j-1], min(dp[i-1][j], dp[i][j-1])) + 1;
                    ret = max(ret, dp[i][j]);
                } else {
                    dp[i][j] = 0;
                }
            }
        }
        printf("%d\n", ret);
    }
    return 0;
}