#include <bits/stdc++.h>
  
using namespace std;
  
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
#define REP(i,n) for(ll i=0;i<n;++i)
#define REPR(i,n) for(ll i=1;i<n;++i)
#define FOR(i,a,b) for(ll i=a;i<b;++i)
  
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()
  
#define MOD (ll)(1e9+7)
#define ADD(a,b) a=((a)+(b))%MOD
#define FIX(a) ((a)%MOD+MOD)%MOD

#define INF 1000000000

typedef long double Real;
#define EPS 1e-13
#define EQ(x) (-EPS<x && x<EPS)
typedef complex<Real> P;
Real dot(P a,P b){return real(conj(a)*b);}
Real cross(P a,P b){return imag(conj(a)*b);}

int mp[1024][1024];
int sm[1024][1024];

int main(){
  while(true){
    int n;
    cin>>n;
    if(!n)break;
    REP(i,n){
      string s;
      cin>>s;
      REP(j,n)sm[i][j] = mp[i][j] = (int)(s[j]=='*');
    }
    REPR(i,n)REP(j,n)sm[i][j]+=sm[i-1][j];
    REP(i,n)REPR(j,n)sm[i][j]+=sm[i][j-1];
    int res = 0;
    REP(i,n)REP(j,n){
      // pos
      if(mp[i][j]==1)continue;
      int low = 1, high = (n-max<int>(i,j))+1;
      while(low+1<high){
        int mid = (low+high)/2;
        // check
        if(sm[i+mid-1][j+mid-1]
          -(j>0?sm[i+mid-1][j-1]:0)
          -(i>0?sm[i-1][j+mid-1]:0)
          +(i>0&&j>0?sm[i-1][j-1]:0) == 0){
          low = mid;
        }else{
          high = mid;
        }
      }
      res = max(res,low);
    }
    cout<<res<<endl;
  }
  return 0;
}