'Returns the total degree of ``f``.
Examples
>>> from sympy import Poly
>>> from sympy.abc import x, y
>>> Poly(x**2 + y*x + 1, x, y).total_degree()
2
>>> Poly(x + y**5, x, y).total_degree()
5'

def total_degree(f):

    if hasattr(f.rep, 'total_degree'):
        return f.rep.total_degree()
    else:
        raise OperationNotSupported(f, 'total_degree')
