You spend $27 on 7 bags of candy to throw while you participate in a parade. The bags cost either $5 or $3. How many bags of each amount did you purchase?