Consider the following scenario involving basic integer operations:
A farmer has 12 apples. He gives away 5 apples to his neighbor and then buys 8 more apples. How many apples does the farmer have now?