Question: Total degree in which a variable appears

How to compute the highest total degree of a polynomial in which a variable, say x, appears?

For example, f := x^2*y+3*x*y^2+x^3*y^3-x^5+y^4*z^5;
then the highest total degree in x is 6.

The degree command does not seem to do what I would like to do, since degree(f,x) will give 5 instead.

Thank you in advance.

Please Wait...