#include <iostream>
#include <fstream>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <complex>
#include <cstdio>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)

int n,dp[1001][1001];

int main(){
	while(cin>>n&&n){
		rep(i,n)fill(dp[i],dp[i]+n,0);
		int ans=0;
		char c;
		rep(i,n)rep(j,n){
			cin>>c;
			if(c=='.'){
				if(!i||!j)dp[i][j]=1;
				else dp[i][j]=min(dp[i-1][j-1],min(dp[i-1][j],dp[i][j-1]))+1;
			}
			ans=max(ans,dp[i][j]);
		}
		cout<<ans<<endl;
	}
}