#include <cstdio>
#include <iostream>
#include <string>

#define reep(i,n,m) for(int i=(n);i<(m);i++)
#define rep(i,n) reep(i,0,n)

using namespace std;

string fld[1000];
int cou[1000][1000] = {0};

int main(){
    int n;
    while(scanf("%d",&n),n){
        rep(i,1000)rep(k,1000)cou[k][i] = 0;
        rep(i,n){
            cin >> fld[i];
        }


        rep(y,n){
            int c=0;
            rep(x,n){
                if(fld[y][x]=='*'){
                    c++;
                }
                cou[y][x] = c;
            }
        }

        int ans=0;
        rep(y,n){
            rep(x,n){
                if(fld[x][y]=='.'){
                    ans = max(ans,1);
                    int len=1;
                    while(len+x<n && len+y<n){
                        int nx = len+x;
                        bool flg=false;
                        reep(ny,y,y+len+1){
                            if(cou[ny][nx]-cou[ny][x-1]){
                                flg=true;
                                break;
                            }
                        }
                        if(flg)
                            break;
                        len++;
                    }
                    if(ans<len){
                        //printf("(%d,%d) len->%d\n",x,y,len);
                    }
                    ans = max(ans,len);
                }
            }
        }

        cout << ans << endl;
    }
}