What is the driving distance between Cody Wyoming and Custer South Dakota?

It is 364 miles accordiing to Google Maps.