Mary wants to buy one large pizza, one medium pizza, and three drinks. The drinks cost p dollars each, the medium pizza costs two times as much as one drink, and the large pizza costs three times as much as one drink. If Mary started with 30 dollars, how much money would she have left after making all of her purchases? Give your answer as an expression of p.