#include <iostream>
#include <algorithm>
using namespace std;
int main(){
  char ma[100][100];
  int n;
  while(cin >> n,n){

    int d[100][100] = {{0}};

    for(int i = 0 ; i < n ; i++){
      for(int j = 0 ; j < n ; j++){
	cin >> ma[j][i];
      }
    }
    for(int i = 0 ; i < n ; i++ ){
      if(ma[i][0] != '*')d[i][0] = 1;
      else d[i][0] = 0;
      if(ma[0][i] != '*')d[0][i] = 1;
      else d[0][i] = 0;
    }
    int MSquare = 1;
    for(int i = 1 ; i < n ; i++ ){
      for(int j = 1 ; j < n ; j++ ){
	if(ma[i][j] == '*'){
	  d[i][j] = 0;
	}else{
	  d[i][j] = min(d[i-1][j-1],min(d[i-1][j],d[i][j-1])) + 1;
	  MSquare = max(MSquare,d[i][j]);
	}
      }
    }

    cout << MSquare << endl;

  }
  return 0;
}