def countNodes(epr):
        """
        Counts the number of nodes in the expression tree.

        Parameters
        ----------
        epr: sympy.expression
        
        Returns
        -------
        int
        """
        result = 1
        argLst = epr.args
        for arg in argLst:
            result += countNodes(arg)
        return result