This is a classic riddle! The answer is 9 sheep are left.

The key is in the phrase "all but 9 die" - this means that all the sheep except for 9 of them died. So if all but 9 die, then 9 survive.

The number 17 (the original total) is included to make you want to do subtraction, but the phrase "all but 9" already tells you directly how many remain alive.
