There were 60 pies before the bake sale started.
Step-by-step explanation
Suppose, there were
number of pies before the bake sale started.
As Mary set aside 2 pies for herself at the beginning of the bake sale, so the remaining number of pies

Karen then bought half of the remaining pies for her birthday party. That means, the remaining number of pies after Karen bought will be:

10 more pies were sold during the sale and there were 19 pies remaining when the sale was over. So, the equation will be......

So, there were 60 pies before the bake sale started.