In the logic,
Under the hood, we first hons-copy X to obtain a normed version, then count the number of unique conses in X using an EQ hash table.
Function:
(defun number-subtrees (x) (declare (xargs :guard t)) (len (cons-subtrees x 'number-subtrees)))