#include <cstdio>

#include <cstdlib>

#include <cmath>

#include <climits>

#include <cfloat>

#include <map>

#include <utility>

#include <set>

#include <iostream>

#include <memory>

#include <string>

#include <vector>

#include <algorithm>

#include <functional>

#include <sstream>

#include <complex>

#include <stack>

#include <queue>

#include <numeric>

#include <cstring>



#define rep(i, n) for(int i = 0; i < (n); i++)

#define pb push_back



using namespace std;



typedef long long ll;

typedef pair<int, int> P;

typedef vector<int> vi;

typedef vector<vi> vvi;



const int INF = 1 << 29;

const double EPS = 1e-9;

const int MAX_N = 1000;



int main(){

	int n, ans;

	vector<string> field;

	vvi memo;



	while(1){

		ans = 0;

		cin >> n;

		if(n == 0) break;



		field.resize(n);

		memo.resize(n+2);



		rep(i, n) cin >> field[i];

		rep(i, n+2){

			memo[i].resize(n+2);

			fill(memo[i].begin(), memo[i].end(), 0);

		}



		rep(i,n){

			rep(j, n){

				if(field[i][j] == '.'){

					memo[i+1][j+1] = min(memo[i+1][j], min(memo[i][j+1], memo[i][j])) + 1;

				}

				ans = max(ans, memo[i+1][j+1]);

			}

		}

		cout << ans << endl;

	}

}