#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;

int sum[1000][1000] = {0};

int main() {
  int H,top=0;
  string str;
  
  while(cin >> H) {
    getline(cin,str);// kill \n
    string field[1000] = {""};
    if(H == 0) break;

    for(int i=0;i<H;i++) { //get field for string
      getline(cin,str);
      field[i] = str;
    }
    if(field[0].substr(0,1) == ".") {
      sum[0][0] = 1;
    }
    else {
      sum[0][0] = 0;
    }    
    for(int j=1;j<H;j++) {
      if(field[0].substr(j,1) == ".") {
	sum[0][j] = 1 + sum[0][j-1];
      }
      else {
	sum[0][j] = sum[0][j-1];
      }
    }

    for(int i=1;i<H;i++) {
      if(field[i].substr(0,1) == ".") {
	sum[i][0] = 1 + sum[i-1][0];
      }
      else {
	sum[i][0] = sum[i-1][0];
      }
    }

    for(int i=1;i<H;i++) {
      for(int j=1;j<H;j++) {
	if(field[i].substr(j,1) == ".") {
	  sum[i][j] = 1 + sum[i-1][j] + sum[i][j-1] - sum[i-1][j-1];
	}
	else {
	  sum[i][j] = sum[i-1][j] + sum[i][j-1] - sum[i-1][j-1];
	}
      }
    }
    for(int i=0;i<H;i++) {
      for(int j=0;j<H;j++) {
	if(field[i].substr(j,1) == ".") {
	  for(int k=1;k<H;k++) {
	    int S = sum[i][j] - sum[i-k][j] - sum[i][j-k] + sum[i-k][j-k];
	    if(S == k*k) {
	      top = max(top,k);
	    }
	    else {
	      break;
	    }
	  }
	}
      }
    }
    
    cout << top << endl;
    top = 0;
  }
}