#include <iostream>
#include <algorithm>
using namespace std;

char a[1000][1000];
int dp[1000][1000];

int main()
{
    int n;
    while(cin >> n, n){
        int ans = 0;
        for(int i = 0; i < n; ++i){
            for(int j = 0; j < n; ++j){
                cin  >> a[i][j];
                if(i == 0 || j == 0) {
                    dp[i][j] = (a[i][j] == '.');
                    ans = max(ans, dp[i][j]); 
                } else if(a[i][j] == '.'){ 
                    dp[i][j] = min(dp[i-1][j-1], min(dp[i][j-1], dp[i-1][j])) + 1;
                    ans = max(ans, dp[i][j]);
                } else dp[i][j] = 0;
            }
        }
        cout << ans << endl;
    }
}