David loves to ride his horse. When he is riding his horse, he travels at a rate of mi/hr, and when he is walking, he travels at a rate of just mi/hr. David goes on a -hour trip, traveling for a while on his horse and walking the rest of the way, and travels miles. For how many minutes was David riding his horse?