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

int dp[1002][1002];

int main() {
    int n;
    while (cin >> n, n) {
        for (int i=0; i<n+2; ++i) {
            for (int j=0; j<n+2; ++j) {
                dp[i][j] = 0;
            }
        }
        int ret = 0;
        char sign;
        for (int i=1; i<=n; ++i) {
            for (int j=1; j<=n; ++j) {
                cin >> sign;
                if (sign == '.') {
                    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]);
                }
            }
        }
        cout << ret << endl;
    }
    return 0;
}