#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double ESP=1e-10;
using namespace std;
int main(){
  int n;
  while(cin>>n,n){
    vector<vector<int> >in(n+1,vector<int>(n+1));
    rep(i,n)rep(j,n){
      char d;
      cin>>d;
      int a;
      if(d=='.')a=1;
      else a=0;
      in[i+1][j+1]=a;
    }
    rep(i,n)rep(j,n)in[i+1][j+1]+=in[i][j+1]+in[i+1][j]-in[i][j];
    /*rep(i,n+1){
      rep(j,n+1)cout<<" "<<in[i][j];
      cout<<endl;
   }*/
    int ma=n;
    while(ma>=0){
      bool h=false;
      loop(i,ma,n+1){
	loop(j,ma,n+1){
	  if(ma*ma==in[i][j]-in[i-ma][j]-in[i][j-ma]+
				   in[i-ma][j-ma]){
	    h=true;
	    break;
	  }
	}
	if(h)break;
      }
      if(h)break;
      ma--;
    }
    cout<<ma<<endl;
  }
}