How can I sum cells containg text?

I have a column of distances: 1km, 2 km, 3 km and I'd like to tally the
distances using a formula.

Thanks!