The pie baked by Bernie has a total of 5+8+9=22 ounces of berries. In the supermarket he gought three containers of 12 ounces so he bought:
So Bernie bought 36 ounces of berries and only used 22 ounces. The remaining ounces are given by the difference between these two quantities:
Then the answer is 14 ounces.