Let the number of apple pies sold and let the number of blueberry pies sold. Then:

(A) (B)

Solve (A) for a:

Substitute into (B):

Multiply, and combine like terms:

The solution of this equation is , which gives you .