Some friends on a hike leave at 9 a.m. and return at 2 p.m. They spend one-quarter of the total distance walking uphill, one-half walking on level ground, and one-quarter walking downhill. If their speed is 4 mph on level ground, 2 mph uph ill, and 6 mph downhill, approximately how far did they walk?