how to extract the number of arguments from a function



Hi all:

I'm doing some computations involving functions with different number of variables (that is, functions f:R^m --> R for different values of m). Given the name of one of these functions, previously defined, I need to know the number of its arguments. So, I have
foo(x,y,z):= whatever
and I need some command that tells me the number of arguments 'foo' has (3 in this case).
There is the command 'showratvars', which could be used for this, but it doesn't work well with functions such as
goo(x,y,z):=y*z^2
for which it returns 2 (the number of variables in the expression y*z^2), but not 3 (the number of arguments of 'goo').

J. A.