Wen was hiking on a 12-mile route. During the first 2 hours, his hiking speed was 3 mph. During the rest of the hike, his speed was 2 mph. How long did the entire hike take?