Answer:
Order your units (just to help),
Make sure your units are systematized in the order given.
Red cars 5 40
__________ __________ = __________, now we solve for x;
Blue cars 3 x
5/3 = 40/x
multiply by x on both sides
5/3x = 40
Then divide by 3/5 from both sides (multiplying by 3/5)
x = 24