This is a system of equations problem. 
Blueberry = X, blackberry = Y
Joe: 
5x + 10y = 135
James: 
x + 9y = 104
Let’s isolate x from James’ equation. 
x = 104 - 9y
Now substitute that into the first equation.
5(104 - 9y) + 10y = 135
520 - 45y + 10y = 135
-35y = -385
y = -385/-35. The negatives cancel out, leaving us with $11 for blackberries. 
Now we can substitute that value into James’s equation. 
x + 9(11) = 104
x = 104 - 99
x = $5
Final answer: Blueberry pies cost $5, blackberry pies cost $11.