#include <iostream>
#include <algorithm>

using namespace std;

constexpr auto N = 1000;

int main()
{
    int n;
    while( cin >> n, n != 0 ) {
        bool s[N+2][N+2] = {};
        for( int y=0; y<n; ++y ) {
            for( int x=0; x<n; ++x ) {
                char c;
                cin >> c;
                s[x+1][y+1] = c == '.';
            }
        }

        int dp[N+2][N+2] = {};
        int m = 0;
        for( int y=0; y<n; ++y ) {
            for( int x=0; x<n; ++x ) {
                if ( s[x+1][y+1] ) {
                    dp[x+1][y+1] = min( dp[x][y], min( dp[x][y+1], dp[x+1][y] ) ) + 1;
                    m = max( m, dp[x+1][y+1] );
                }
            }
        }

        cout << m << endl;
    }
}