When two or more objects move together, then it usually simplies the problem solving to treat them as a single "compound body."
Whenever a compound body is used, its mass is just the sum of the masses of its parts.

For instance, if horse pulls a cart containing a man and an woman, and the problem asks you to determine the force exerted on the cart by the horse, then the problem will be simpler if you define a compound body consisting of the man, the woman and the cart.
In this case, the mass of the compound body is just the sum of the mass of the cart, the mass of the man and the mass of the woman.