#include<iostream>
using namespace std;
int i, j;
int dp[1000][1000];
char cp[1000][1000];

int min(int a,int b){
  int mp;
  if(a<b)mp=a;
  else mp=b;

  return mp; 
}





int main(void){
  
  int n, i, j, a, b;
  //int dp[1000][1000];
  int sq=0;
  
  while(1){
    
    cin >> n;
    sq=0;
  
  if(n==0){break;}
  
  else{
    for(i=0; i<n; i++){
      for(j=0; j<n; j++){
	
	cin >> cp[i][j];
	
	//ã[,¶[Ì
	if((i==0 || j==0)&& cp[i][j]=='.'){
	  dp[i][j]=1;
	}
	if(cp[i][j]=='*'){
	  dp[i][j]=0;
	}
	
	

	//
	else if(i-1>=0 && j -1>=0){
	dp[i][j]=min(dp[i-1][j], min(dp[i-1][j-1], dp[i][j-1]))+1;
	}

	//êÔ½«¢³û`ðÛ¶
	if(dp[i][j]>sq)sq=dp[i][j];
      }
      
    }            
  }
  
  printf("%d\n", sq);
  
  }
 
  return 0;
 
}