#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
  int n;
  bool field[1000][1000] = {false};
  while(cin >>n,n){
    cin.ignore();
    for(int i=0; i<n; i++){
      string l;
      getline(cin,l);
      for(int j=0; j<n; j++){
	if(l[j] == '*'){field[j][i] = 1;}
	else if(l[j] == '.'){field[j][i] = 0;}
      }
    }
    int dp[1000][1000] = {0};
    for(int i=0; i<n; i++){
      for(int j=0; j<n; j++){
	if(field[j][i] == 0){
	  if(i == 0 || j == 0){dp[j][i] = 1;}
	  else{dp[j][i] = min(min(dp[j-1][i],dp[j][i-1]),dp[j-1][i-1])+1;}
	}
      }
    }
    int ans = 0;
    for(int i=0; i<n; i++){
      for(int j=0; j<n; j++){
	if(dp[i][j] > ans){ans = dp[i][j];}
      }
    }
    cout <<ans<<endl;
  }
  return 0;
}