#include<iostream>
#include<vector>
#include<algorithm>
#include<iomanip>
using namespace std;
int dp[1001][1001];
int calc(int i,int j,int k){
    return dp[i+k][j+k]-dp[i-1][j+k]-dp[i+k][j-1]+dp[i-1][j-1];
}
int main(){
    int n;
    while(cin>>n,n){
        fill(dp[0],dp[0]+1001*1001,0);
        for(int i=0;i<n;i++){
            string str;
            cin>>str;
            for(int j=0;j<n;j++){
                dp[i+1][j+1]=dp[i+1][j]+dp[i][j+1]-dp[i][j];
                if(str[j]=='*')dp[i+1][j+1]++;
            }
        }
        int Max=0;
        for(int i=1;i<=n;i++){
            for(int j=1;j<=n;j++){
                int l=0,r=n;
                if(calc(i,j,0)!=0)continue;
                while(r-l>=0){
                    int k=(r+l)/2;
                    int sum=calc(i,j,k);
                    if(sum!=0)r=k-1;
                    else l=k+1;
                }
                Max=max(r+1,Max);
            }
        }
        cout<<Max<<endl;

    }
}