Measuring how far a nonbinary phylogenetic network is from being tree-based