Two teams of 20 people each participated in a relay race from Moscow to Petushki. Each team divided the distance into 20 segments, not necessarily of equal length, and assigned them to participants such that each member runs exactly one segment (each participant maintains a constant speed, but the speeds of different participants may vary). The first participants of both teams started simultaneously, and the baton exchange occurs instantaneously. What is the maximum number of overtakes that could occur in such a relay race? Note that an overtaking at the boundary of the stages is not considered as an overtake.
(2023-96, E. Neustroeva)