If there were 9 apples and John ate 8 of them, then went to the supermarket to buy another apple. How many apples does John have?