Defining C(n,r) as the number of combinations (order does not count) to choose r objects from n, where C(n,r)=n!/(r!(n-r)!)
there are
C(58,3) ways to choose 3 from 58 republicans,
and
C(39,2) ways to choose 2 from 39 democrats.
So the committee has
(C(58,3)*(C(39,2)) variants, or
58!/(3!55!) * 39!/(2!37!)
=30856*741
=22864296