#include<iostream>
#include<cstdlib>
#include<cstring>
using namespace  std;
#define rep(i,n) for(int i=0;i<n;i++)

char masu[1010][1010];
int maxs[1010][1010];

int main()
{
    int n;
    while(cin>>n)
    {
        if(n==0)break;
        memset(masu,'*',sizeof(masu));
        memset(maxs,0,sizeof(maxs));
        rep(j,n)rep(i,n){
            cin>>masu[i+1][j+1];
        }
        int ms = 0;
        int hen = 0;
        int temp=0;
        int count=0;
        rep(j,n)rep(i,n){
            count ++;
            if(masu[i+1][j+1] =='*'){maxs[i+1][j+1]=0; continue;}
            temp = min(maxs[i][j+1],maxs[i][j]);
            temp = min(temp,maxs[i+1][j]);
            temp++;
            maxs[i+1][j+1] = temp;
            ms = max(ms,maxs[i+1][j+1]);
        }
        cout << ms << endl;
    }
    return 0;
}