How do you answer this problem?: A shop sells one-pound bags of peanuts for $2 and three- pound bags for $5. If 9 bags are purchased for a total cost of $36, how many three-pound bags were purchased?