You can change the units so that they are equal and then use Pythagoras Theorem.

As 1km = 1000m you can either change 12.7km into 12,700m or 8.9m into 8.9*10^-3km and then use Pythagoras.

Either way should give you an answer of 12.7km (=12,700m) (3sf). Note that in this case the answer is virtually the same as the slope. This is because the slope is much bigger than the horizontal distance and so 8.9^2 is negligible compared to 12,700^2