#include<iostream>
#include<cstdio>
#include<algorithm>
#include<limits.h>
#define M 10000
char map[M][M];
int  ans[M][M];
using namespace std;

int main(){
  int n,i,j,xmax=0;
  while(1){
    xmax=0;
    cin >> n;
    if(n == 0)break;
    
    
    for(i=0;i<n;i++){
      for(j=0;j<n;j++){
	cin >> map[i][j];
	ans[i][j] = (map[i][j] == '.') ? 1 : -1;
      }
    }
    
     
    
    
    for(i=1;i<n;i++){
      for(j=1;j<n;j++){
	if(ans[i][j] == -1){}
	else{
	  if(ans[i-1][j-1]>0 && ans[i-1][j]>0 && ans[i][j-1]>0)ans[i][j]=min(ans[i-1][j-1],min(ans[i-1][j],ans[i][j-1]))+1;
	  else if(ans[i-1][j-1]<0 || ans[i-1][j]<0 || ans[i][j-1]<0){}

}
	if(ans[i][j] != INT_MAX)xmax=max(ans[i][j],xmax);

      }
    }
    /*    
 for(i=0;i<n;i++){
      for(j=0;j<n;j++){
	cout << ans[i][j]  ;
      }
      cout << " " << endl;
      }
    */

    cout << xmax << endl;
    
  }
}