#define _USE_MATH_DEFINES
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <cassert>
#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 <list>
#include <iomanip>
#include <iterator>

using namespace std;

typedef long long ll;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;

 
int n;
char s[1000][1001];
int t[1001][1001];

int solve(){
	memset(t,0,sizeof(t));
	for(int i =0 ; i < n; i++){
		char s[1001]; cin>>s;
		for (int j = 0; j < n; j++){
			t[i+1][j+1] = (s[j] == '.') + t[i][j+1] + t[i+1][j] - t[i][j];
		}
	}

	int ans = 0;
	for (int i = 0; i < n; i++){
		for (int j = 0; j < n; j++){
			int a = 0;
			for (int k = 1; k <= min(n - i,n - j); k++){
				int s = t[i+k][j+k] - (t[i][j+k] + t[i+k][j] - t[i][j]);
				if(s != k * k) break;
				a = k;
			}
			ans = max(ans,a);
		}
	}
	return ans;
}

int main(){
    while(cin>>n,n){
        cout << solve() << endl;
    }
    return 0;
}