#include <bits/stdc++.h>
#define PB push_back
#define MP make_pair
#define REP(i,n) for (int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define ALL(a) (a).begin(),(a).end()
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
const int INF=1e9;
const int MOD=100000;
int cnt[1000][1000];
int main(){
      int n;
      char fld[1000][1000];
      while(scanf("%d",&n)&&n){
            memset(cnt,0,sizeof(cnt));
            REP(i,n){
                  scanf("%s",fld[i]);
                  REP(j,n)if(fld[i][j]=='*')cnt[i][j]++;
            }
            //REP(i,n){REP(j,n)cout<<cnt[j][i];cout<<endl;}
            REP(i,n)REP(j,n){
                  if(i!=0)cnt[j][i]+=cnt[j][i-1];
                  if(j!=0)cnt[j][i]+=cnt[j-1][i];
                  if(i!=0&&j!=0)cnt[j][i]-=cnt[j-1][i-1];
            }
            //REP(i,n){REP(j,n)cout<<cnt[j][i]<<" ";cout<<endl;}
            int ans=0;
            REP(x,n)REP(y,n){
                  REP(d,min(n-x,n-y)){
                        int nx=x+d,ny=y+d;
                        int c=cnt[ny][nx];
                        if(x!=0)c-=cnt[ny][x-1];
                        if(y!=0)c-=cnt[y-1][nx];
                        if(x!=0&&y!=0)c+=cnt[y-1][x-1];
                        if(c==0&&ans<d+1){
                              //cout<<x<<" "<<y<<" "<<d+1<<endl;
                              ans=d+1;
                        }
                  }
            }
            printf("%d\n",ans);
      }
}