tree: countNodes sketch