#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

int main()
{
    for(;;){
        int n;
        cin >> n;
        if(n == 0)
            return 0;

        vector<string> s(n);
        for(int i=0; i<n; ++i)
            cin >> s[i];

        vector<vector<int> > dp(n, vector<int>(n, 0));
        int ret = 0;
        for(int i=0; i<n; ++i){
            if(s[0][i] == '.'){
                dp[0][i] = 1;
                ret = 1;
            }
            if(s[i][0] == '.'){
                dp[i][0] = 1;
                ret = 1;
            }
        }
        for(int i=1; i<n; ++i){
            for(int j=1; j<n; ++j){
                if(s[i][j] == '.'){
                    dp[i][j] = min(dp[i-1][j-1], min(dp[i][j-1], dp[i-1][j])) + 1;
                    ret = max(ret, dp[i][j]);
                }
            }
        }
        cout << ret << endl;
    }
}