How To Calculate The Total Distance