So.. .at the beginning of the sale, there was a total of "x" pies
now, let's see what happened to those pies
![\bf \begin{array}{lrlll} &pies\\\\ &\textendash\textendash\textendash\textendash\textendash\textendash&\\ Mary&x-2\\\\ Kate&\cfrac{x-2}{2}\\\\ \textit{pies sold}&10\\\\ \textit{pies leftover}&14 \end{array}](https://tex.z-dn.net/?f=%5Cbf%20%5Cbegin%7Barray%7D%7Blrlll%7D%0A%26pies%5C%5C%5C%5C%0A%26%5Ctextendash%5Ctextendash%5Ctextendash%5Ctextendash%5Ctextendash%5Ctextendash%26%5C%5C%0A%0AMary%26x-2%5C%5C%5C%5C%0AKate%26%5Ccfrac%7Bx-2%7D%7B2%7D%5C%5C%5C%5C%0A%5Ctextit%7Bpies%20sold%7D%2610%5C%5C%5C%5C%0A%5Ctextit%7Bpies%20leftover%7D%2614%0A%5Cend%7Barray%7D)
so, we had "x"
then Mary took 2, she left x - 2
Kate took half of that (x-2)/2
then 10 were sold, and 14 leftover
if we subtract all those figures, and solve for "x",
we should get what "x" was, so
![\bf (x-2)-\left( \cfrac{x-2}{2} \right)-10-14=0](https://tex.z-dn.net/?f=%5Cbf%20%28x-2%29-%5Cleft%28%20%5Ccfrac%7Bx-2%7D%7B2%7D%20%5Cright%29-10-14%3D0)
notice, if we subtract what Mary took, and Kate, and the sold and leftover, from the original "x", we would end up with no pies :)
so.. just solve for "x"