kim spent 1/2 of her money on a cake and 1/3 on sodas She had $40 left . How much did she spend and how much was her total amt.Help me work this out

(1/2)M + (1/3)M + 40 = M

multiply by 6

3 M + 2 M + 240 = 6 M

240 = M

spent M-40 = 200