#include <iostream>
#include <fstream>
#include <typeinfo>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <iomanip>
#include <cctype>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<25;
const double pi=acos(-1);
const double eps=1e-8;
const vi emp;

int N;

int main(){
	while(1){
		cin>>N;
		if(!N) break;
		int ans=0;
		vvc field(N,vc(N));
		vvi dp(N+1,vi(N+1));
		for(int i=0;i<N;i++) for(int j=0;j<N;j++) cin>>field[i][j];
		for(int i=1;i<=N;i++) for(int j=1;j<=N;j++){
			if(field[i-1][j-1]=='.') dp[i][j]=min(dp[i-1][j-1]+1,min(dp[i-1][j]+1,dp[i][j-1]+1));
			else dp[i][j]=0;
			ans=max(ans,dp[i][j]);
		}
		cout<<ans<<endl;
	}
}