def close_parens_needed(expr):
    """Return the number of left-parentheses needed to make 'expr'
       balanced.

    >>> close_parens_needed("1+2")
    0
    >>> close_parens_needed("(1 + 2)")
    0
    >>> close_parens_needed("(1 + 2")
    1
    >>> close_parens_needed("(1 + (2 *")
    2
    >>> close_parens_needed("(1 + (2 * 3) + (4")
    2
    """
    return expr.count("(") - expr.count(")")