#include "bits/stdc++.h"

#define REP(i,num) for(int i=0;i<(num);++i)
#define ALL(c) c.begin(),c.end()
#define LOOP(i) while(i--)
#define PRINTALL(c) for(auto& x:c){cout<<x<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=int>
T in(){T x; cin >> x; return (x);}
template<typename T=int,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout<<fixed<<setprecision(10);

	while(true){
		int N=in();
		if(!N) break;
		
		vector<vector<int>> S(N+1,vector<int>(N+1,0));
		REP(i,N){
			string T=in<string>();
			REP(j,N){
				if(T[j]=='*') S[i+1][j+1] = 1; 
			}
		}
		REP(i,N+1){
			REP(j,N){
				S[i][j+1] += S[i][j]; 
			}
		}
		REP(j,N+1){
			REP(i,N){
				S[i+1][j] += S[i][j]; 
			}
		}
		int left=0,right=N;
		while(right-left>0){
			int mid = (right+left)/2+1;
			bool exist = false;
			for(int i=0;i<N-mid+1;i++){
				for(int j=0;j<N-mid+1;j++){
					if(S[i][j]+S[i+mid][j+mid]-S[i+mid][j]-S[i][j+mid]==0){
						exist = true;
						break;
					}
				}
			}
			if(exist){
				left = mid;
			}
			else{
				right = mid-1;
			}
		}
		out(left);
	}

	return 0;
}
