Given two cities and their distances, calculate the total distance
Input: Berlin to Munich, 284 km; Munich to Dresden, 294 km
The total distance is 578 km.
The total distance from Berlin to Dresden is 294 km.