#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<string>
using namespace std;
char fie[1111][1111];
int rui[1111][1111];
main(){
  int N;
  while(1){
    cin >> N;
    if(N==0) break;
    for(int i=1;i<=N;i++){
      for(int j=1;j<=N;j++)
	cin >> fie[j][i];
    }
    memset(rui,0,sizeof(rui));
    for(int i=1;i<=N;i++){
      if(fie[1][i]=='.') rui[1][i]=1;
      for(int j=2;j<=N;j++){
	rui[j][i]=rui[j-1][i];
	if(fie[j][i]=='.') rui[j][i]++;
      }
    }

    for(int j=1;j<=N;j++){
      for(int i=2;i<=N;i++){
	rui[j][i]+=rui[j][i-1];
      }
    }
    /*
          for(int i=1;i<=N;i++){
	for(int j=1;j<=N;j++) printf("%2d ",rui[j][i]);
	puts("");
      }
    */
    int res=0;
    for(int i=1;i<=N;i++){
      for(int j=1;j<=N;j++){
	if(fie[j][i]=='*') continue;
	int st=0,ed=min(N-j,N-i);
	int ret=0;
	//	cout << j << ":" << i << endl;
	while(st<=ed){
	  int h=(st+ed)/2;
	  int r = rui[j+h][i+h]-rui[j+h][i-1]-rui[j-1][i+h]+rui[j-1][i-1];
	  //	  cout << r << " " <<rui[j+h][i+h]<<" "<<rui[j+h][i-1]<<" "<<rui[j-1][i+h]<<" "<<rui[i-1][j-1]<<" "<< h << endl;
	  if( r >= (h+1)*(h+1) ){
	    st = h+1;
	    ret=h+1;
	  }
	  else ed = h-1;
	}
	res = max(res,ret);
      }
    }
    cout << res << endl;

  }
}