#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> mp;
#define inf 1e9


int main(){
while(1){
	int n;
	cin>>n;
	if(n==0)break;
	vector<vector<int> > dp(n+2,vector<int>(n+2,0) );
	vector<vector<bool> > used(n+2,vector<bool>(n+2,false) );
	for(int i=1;i<=n;i++)
	    for(int j=1;j<=n;j++){
		char tmp;
		cin>>tmp;
		if(tmp=='.'){
			used[i][j] = true;
		}
	    }

	int res = 0;
	for(int i=1;i<=n;i++)
	    for(int j=1;j<=n;j++){
		if(used[i][j]){
			dp[i][j] = min(dp[i-1][j-1], min( dp[i][j-1], dp[i-1][j] ) ) + 1;
			res = max(res,dp[i][j]);
		}
	    }
	cout<<res<<endl;


}
	return 0;
}

