If the farmer has 17 sheep and all but 9 die, that means 9 sheep are still alive. So, there are 9 sheep left.
