How to find total distance traveled physics