Grandma’s Bakery sells single-crust apple pies for $6.99 and double crust cherry pies for $10.99. The total number of pies sold on a busy Friday was 36. If the amount collected for all the pies that day was $331.64, how many of each type were sold?