107. An Aeroflot cashier needs to deliver tickets to five groups of tourists. Three of these groups are staying at the hotels "Druzhba", "Rossiya", and "Minsk". The address of the fourth group will be provided by the tourists from "Rossiya", and the address of the fifth group will be provided by the tourists from "Minsk". In how many ways can the cashier choose the order of visiting the hotels to deliver the tickets?
Solution. First, let's calculate the number of ways to visit the hotels if there are no restrictions on the order of the visits. Then, the first hotel can be chosen in 5 ways, the second in 4 ways, so the first two hotels can be chosen in 20 ways; the third hotel can be chosen in 3 ways, so for the first three hotels, there are 60 ways $(5 \cdot 4 \cdot 3=60)$. Finally, the fourth hotel can be chosen in 2 ways. Thus, there are 120 ways $(2 \cdot 4 \cdot 3 \cdot 2=120)$ to visit all the hotels.

The problem requires the cashier to go to "Russia" before the fourth hotel; this reduces the number of ways by exactly half, as the number of ways in which "Russia" is visited earlier is the same as the number of ways in which it is visited later. Similarly, the second restriction of the problem also reduces the number of possible ways by half. Therefore, the cashier has 30 ways $(120: 2: 2=30)$ to visit all the hotels.

Answer: 30 ways.