#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <cstring>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <fstream>
#include <complex>
#include <stack>
#include <queue>

using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
static const double EPS = 1e-5;

#define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)

int max_l(string s){
  int r=0,ret=0;
  REP(i,s.size()){
    if(s[i]=='*'){
      ret = max(ret,r);
      r=0;
    }else{
      r++;
    }
  }
  ret = max(ret,r);
  return ret;
}
int max_l(int i,vector<string> s){
  int r=0,ret=0;
  REP(j,s.size()){
    if(s[j][i]=='*'){
      ret = max(ret,r);
      r=0;
    }else{
      r++;
    }
  }
  ret = max(ret,r);
  return ret;
}


int main(void){
  int n;
  while(cin>>n){
    if(n==0) break;
    int m=0;
    vector<string> grid(n);
    REP(i,n){
      cin>>grid[i];
    }  
    REP(i,grid.size()){
      m = max(m,max_l(grid[i]));
    }
    REP(i,grid[0].size()){
      m = max(m,max_l(i,grid));
    }
    bool out =false;
    for(int i=m; i>0; i--){
      for(int j=0; i+j<=n; j++){
        for(int k=0; i+k<=n; k++){
          bool f = true;
          for(int x=j; x<i+j; x++){
            for(int y=k; y<i+k; y++){
              if(grid[y][x]=='*'){
                f = false;
                break;
              }
            }
            if(!f) break;
          }
          if(f){
            cout<<i<<endl;
            out = true;
            break;
          }
        }
        if(out) break;
      }
      if(out) break;
    }
  }
  return 0;
}