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

int main() {
  int H,x,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;
    }

    for(int i=0;i<H;i++) { // calc
      for(int j=0;j<H;j++) {

        if(field[i].substr(j,1) == ".") {
          x=1;bool r = true;

          for(int k=0;k<min(top,H-j);k++) {
            if(field[i].substr(j+k,1) != ".") {
              r = false;
            }
          }
          while(r) {
            if(H-1<i+x || H-1<j+x) break;
            for(int i1=0;i1<=x;i1++) {
              if(field[i+x].substr(j+i1,1) != ".") {
                r = false;
                break;
              }
            }
            for(int i1=0;i1<=x;i1++) {
              if(field[i+i1].substr(j+x,1) != ".") {
                r = false;
                break;
              }
            }
            if(r) {
              x++;
            }
          }
        }
        else {
          x=0;
        }
        top = max(x,top);
      }
    }
    cout << top << endl;
    top = 0;
  }
}