In a school, there are two bells, one in the primary wing and the other in the secondary wing. Both the bells ring after every class. The duration of each class in the primary and the secondary wing is 45 minutes and 1 hour, respectively. After how many hours would both the bells ring at the same time again if the first class in each wing starts at the same time.