#include<cstdio>
#include<algorithm>
using namespace std;
int tate[1005][1005];
int yoko[1005][1005];
int dp[1005][1005];
char c[1005][1005];
int main(){
  int n;
  while(scanf("%d",&n),n!=0){
    for(int i=1;i<=n;i++){
      scanf("%s",c[i]+1);
    }
    for(int i=0;i<=n;i++){
      tate[0][i] = 0;
      yoko[i][0] = 0;
      dp[0][i] = 0;
      dp[i][0] = 0;
    }
    int ans = 0;
    for(int i=1;i<=n;i++){
      for(int j=1;j<=n;j++){
	tate[i][j] = 0;
	yoko[i][j] = 0;
	if(c[i][j] == '.'){
	  tate[i][j] = tate[i-1][j]+1;
	  yoko[i][j] = yoko[i][j-1]+1;
	  dp[i][j] = min(tate[i][j],yoko[i][j]);
	  dp[i][j] = min(dp[i][j],dp[i-1][j-1]+1);
	  ans = max(ans,dp[i][j]);
	}
      }
    }
    printf("%d\n",ans);
  }
  return(0);
}

