How many constants-of-motion for a given Hamiltonian?

I am using Jose & Saletan's "Classical Dynamics", where they introduce a rather contrived Hamiltonian in the problem set: $$H(q_1,p_1,q_2,p_2) = q_1p_1-q_2p_2 - aq_1^2 + bq_2^2$$ where a and b are constants. This Hamiltonian has several constants-of-motion, including f = q1q2, as can be easily checked. In fact, at this point I am aware of four "functionally independent" constants of motion.

Since this Hamiltonian is a function of four variables, is there some theorem that says there are at most four functionally independent constants of motion? If not, then how would I know when I have found enough to form a basis?

----

Note: The authors define functions f and g to be functionally independent if both functions can be written as functions of a third function. It would seem that this is a relatively obscure topic.

Khashishi
That definition of functionally independent isn't clear enough.
If ##E## and ##L## are constants of motion, then ##E^L## and ##2E-L## and any other combinations are also constants of motion.
If ##K## is a constant of motion, then so is ##E+K##. But is ##E+K## functionally independent with ##E^L##?

That definition of functionally independent isn't clear enough.
If ##E## and ##L## are constants of motion, then ##E^L## and ##2E-L## and any other combinations are also constants of motion.
If ##K## is a constant of motion, then so is ##E+K##. But is ##E+K## functionally independent with ##E^L##?
Thanks Khashishi. I have assumed that functional independence extends to more than two functions in the analogous way that linear independence does. That is, if ##E## and ##L## are constants of the motion, ##\{E,L,E^L\}## is not a functionally independent set.

Said differently, what is the least number of constants-of-motion that can be combined to form all other constants of motion? In my case, is this four? Is there a general theorem?

wrobel