#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b) - 1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)

#define PB push_back
#define INF INT_MAX/3
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define CLR(a) memset(a,0,sizeof(a))

typedef long long int ll;

using namespace std;

int main(){
    while(true){
	int n;
	cin >> n;
	vector< vector<char> > map(n,vector<char>(n,'.'));
	REP(i,n){
	    REP(j,n){
		cin >> map[i][j];
	    }
	}
	if(n == 0) break;
	bool flg = true;
	RREP(i,n){
	    REP(j,n-i){
		REP(k,n-i){
		    flg = true;
		    REP(l,i){
			REP(m,i){
			    if(map[j+l][k+m] == '*'){
				flg = false;
				break;
			    }
			}
			if(!flg) break;
		    }
		    if(flg){
			cout << i << endl;
			break;
		    }
		}
		if(flg) break;
	    }
	    if(flg) break;
	}
    }
    return 0;
}