He walked 6 km in one direction and five back. The hailed a cab for the last km.

That's what I do except that he walked 8 km more than me