There are 9 sheep left.

The phrase "all but 9" means "all except 9". So, 9 sheep survived.
